58% perfecty-push-notifications

Code Review | Perfecty Push Notifications

WordPress plugin Perfecty Push Notifications scored58%from 54 tests.

About plugin

  • Plugin page: perfecty-push-not...
  • Plugin version: 1.6.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 26, 2020
  • Latest release: Oct 3, 2022
  • Number of updates: 91
  • Update frequency: every 7.1 days
  • Top authors: rwngallego (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

6,000+ active /30,335 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.67MB] [CPU: ▼3.71ms] Passed 4 tests

A check of server-side resources used by Perfecty Push Notifications
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6444.57 ▲5.33
Dashboard /wp-admin4.01 ▲0.6655.10 ▼2.61
Posts /wp-admin/edit.php4.12 ▲0.7659.96 ▲12.71
Add New Post /wp-admin/post-new.php6.59 ▲0.7090.97 ▼24.09
Media Library /wp-admin/upload.php3.90 ▲0.6741.41 ▲6.54
Logs /wp-admin/admin.php?page=perfecty-push-logs3.9039.92
Settings /wp-admin/admin.php?page=perfecty-push-options3.9040.24
Users /wp-admin/admin.php?page=perfecty-push-users3.9143.33
Send notification /wp-admin/admin.php?page=perfecty-push-send-notification3.9242.25
About /wp-admin/admin.php?page=perfecty-push-about3.9040.73
Dashboard /wp-admin/admin.php?page=perfecty-push3.9440.24
Notification jobs /wp-admin/admin.php?page=perfecty-push-notifications3.9143.30

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 685 new files
Database: 3 new tables, 10 new options
New tables
wp_perfecty_push_notifications
wp_perfecty_push_logs
wp_perfecty_push_users
New WordPress options
perfecty_push_version
widget_recent-comments
db_upgraded
perfecty_push_activated
can_compress_scripts
perfecty_push
widget_recent-posts
perfecty_push_db_version
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Perfecty Push Notifications
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,044 ▲29815.01 ▲0.633.83 ▲2.1036.37 ▼8.02
Dashboard /wp-admin2,443 ▲2556.63 ▲1.77140.23 ▲35.0144.20 ▲0.59
Posts /wp-admin/edit.php2,349 ▲2573.54 ▲1.5749.82 ▲4.4631.71 ▼8.34
Add New Post /wp-admin/post-new.php6,300 ▲4,78118.93 ▼4.19866.97 ▲193.4040.47 ▼19.19
Media Library /wp-admin/upload.php1,491 ▲1034.21 ▼0.0285.33 ▼21.2644.88 ▼0.77
Logs /wp-admin/admin.php?page=perfecty-push-logs1,0443.1844.5623.86
Settings /wp-admin/admin.php?page=perfecty-push-options1,3613.1944.1535.13
Users /wp-admin/admin.php?page=perfecty-push-users1,1873.1943.3625.31
Send notification /wp-admin/admin.php?page=perfecty-push-send-notification1,2963.2043.9722.01
About /wp-admin/admin.php?page=perfecty-push-about1,0913.2440.1766.63
Dashboard /wp-admin/admin.php?page=perfecty-push1,1664.89131.0525.69
Notification jobs /wp-admin/admin.php?page=perfecty-push-notifications1,2613.1944.8625.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 3 tables
    • wp_perfecty_push_notifications
    • wp_perfecty_push_logs
    • wp_perfecty_push_users
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • perfecty_push_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • perfecty_push
    • perfecty_push_db_version
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/perfecty-push-notifications/public/js/service-worker-loader.js.php
  • 292× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-key-mgmt/Tests/CertificateTest.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Jose\\Component\\KeyManagement\\Analyzer\\KeysetAnalyzer' not found in wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-key-mgmt/Analyzer/MixedKeyTypes.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\umberConverterInterface' not found in wp-content/plugins/perfecty-push-notifications/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Jose\\Component\\Signature\\Serializer\\Serializer' not found in wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-signature/Serializer/JSONFlattenedSerializer.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/perfecty-push-notifications/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/perfecty-push-notifications/vendor/brick/math/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/perfecty-push-notifications/vendor/brick/math/random-tests.php on line 10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/perfecty-push-notifications/vendor/guzzlehttp/psr7/src/Request.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzer' not found in wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-key-mgmt/Analyzer/AlgorithmAnalyzer.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/perfecty-push-notifications/admin/partials/perfecty-push-admin-notifications-view.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-signature-algorithm-ecdsa/Tests/ECDSAFromRFC6979Test.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: push notifications, web push notifications, notifications, user engagement

perfecty-push-notifications/perfecty-push.php 85% from 13 tests

The primary PHP file in "Perfecty Push Notifications" version 1.6.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 159 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("perfecty-push-notifications.php" instead of "perfecty-push.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/perfecty-push-notifications/vendor/web-token/jwt-key-mgmt/Tests/Chain/google.crt
42,985 lines of code in 567 files:
LanguageFilesBlank linesComment linesLines of code
PHP4857,78620,25632,474
Markdown331,91905,303
JSON26102,696
CSS689931,795
JavaScript86033538
XML4121127
YAML42043
make1409

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.47
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces66
Interfaces65
Traits11
Classes372
▷ Abstract classes164.30%
▷ Concrete classes35695.70%
▷ Final classes8724.44%
Methods2,677
▷ Static methods47017.56%
▷ Public methods2,28085.17%
▷ Protected methods1003.74%
▷ Private methods29711.09%
Functions229
▷ Named functions10043.67%
▷ Anonymous functions12956.33%
Constants292
▷ Global constants175.82%
▷ Class constants27594.18%
▷ Public constants23384.73%

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
12 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%
admin/css/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
admin/css/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
admin/css/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
admin/css/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%