62% reachdrip-web-push-notifications

Code Review | ReachDrip - Web Push Notifications

WordPress plugin ReachDrip - Web Push Notifications scored62%from 54 tests.

About plugin

  • Plugin page: reachdrip-web-pus...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.5-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 3, 2019
  • Latest release: Oct 12, 2019
  • Number of updates: 8
  • Update frequency: every 9.6 days
  • Top authors: reachdrip (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /527 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.58MB] [CPU: ▼33.68ms] Passed 4 tests

This is a short check of server-side resources used by ReachDrip - Web Push Notifications
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3246.70 ▲7.88
Dashboard /wp-admin3.38 ▲0.0333.90 ▼31.77
Posts /wp-admin/edit.php3.38 ▲0.0233.71 ▼25.58
Add New Post /wp-admin/post-new.php3.38 ▼2.5132.66 ▼73.97
Media Library /wp-admin/upload.php3.38 ▲0.1534.18 ▼3.38
ReachDrip /wp-admin/admin.php?page=reachdrip-admin3.3831.62
Create Account /wp-admin/admin.php?page=reachdrip-create-account3.3830.10

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ReachDrip - Web Push Notifications
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.16 ▼0.231.78 ▲0.0044.90 ▲0.76
Dashboard /wp-admin2,238 ▲585.80 ▲0.1797.90 ▲4.9285.55 ▲44.66
Posts /wp-admin/edit.php2,140 ▲402.98 ▲0.9637.02 ▼2.6434.45 ▼7.56
Add New Post /wp-admin/post-new.php1,562 ▲3424.08 ▲0.87720.80 ▲45.7438.39 ▼20.51
Media Library /wp-admin/upload.php1,431 ▲285.39 ▲1.19106.45 ▲4.5782.38 ▲38.25
ReachDrip /wp-admin/admin.php?page=reachdrip-admin2,7963.7052.3954.58
Create Account /wp-admin/admin.php?page=reachdrip-create-account2,7963.8452.8734.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/reachdrip-web-push-notifications/admin/class-reachdrip-admin.php+651
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

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
Almost there, just fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=reachdrip-create-account
    • > Notice in wp-content/plugins/reachdrip-web-push-notifications/admin/class-reachdrip-admin.php+763
    Trying to access array offset on value of type bool

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/reachdrip-web-push-notifications/public/partials/reachdrip-public-display.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-subscribers-stats.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-create-account.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-new-notification.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-segment-list.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-dashboard.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-notification-history.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/reachdrip-web-push-notifications/admin/class-reachdrip-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-campaign.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-new-segments.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/reachdrip-web-push-notifications/admin/partials/reachdrip-setting.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
  • Tags: There are too many tags (47 tag instead of maximum 10)
You can look at the official readme.txt

reachdrip-web-push-notifications/reachdrip.php 85% from 13 tests

The entry point to "ReachDrip - Web Push Notifications" version 2.0.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("reachdrip-web-push-notifications.php" instead of "reachdrip.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 147 characters long)

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
Success! There were no dangerous files found in this plugin7,681 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP201,0936533,296
JavaScript51785052,332
CSS2133431,228
PO File2353567825

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity38.86
▷ Minimum class complexity1.00
▷ Maximum class complexity231.00
Average method complexity5.21
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods63
▷ Static methods3555.56%
▷ Public methods5892.06%
▷ Protected methods00.00%
▷ Private methods57.94%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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.23MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/reachdrip.png0.98KB0.67KB▼ 31.70%
admin/images/flags.png67.65KB23.60KB▼ 65.12%
admin/images/flags@2x.png169.54KB64.26KB▼ 62.10%