68% buoy

Code Review | Buoy

WordPress plugin Buoy scored68%from 54 tests.

About plugin

  • Plugin page: buoy
  • Plugin version: 0.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: ([0-9.]+)$/', $line, $m);-4.7
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: Dec 19, 2016
  • Number of updates: 205
  • Update frequency: every 2.2 days
  • Top authors: meitar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,784 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▲0.25ms] Passed 4 tests

This is a short check of server-side resources used by Buoy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2138.04 ▼5.62
Dashboard /wp-admin3.55 ▲0.2552.91 ▼3.88
Posts /wp-admin/edit.php3.59 ▲0.2355.39 ▲3.45
Add New Post /wp-admin/post-new.php6.20 ▲0.3199.60 ▲7.07
Media Library /wp-admin/upload.php3.47 ▲0.2444.61 ▲10.10
Team membership /wp-admin/edit.php?post_type=buoy_team&page=buoy_team_membership3.4539.79
Buoy /wp-admin/options-general.php?page=buoy_settings3.5346.92
Respond to Alert /wp-admin/admin.php?page=buoy_review_alert3.4542.71
All Teams /wp-admin/edit.php?post_type=buoy_team3.5248.12
Incident Chat /wp-admin/admin.php?page=buoy_chat3.4237.93
Activate Alert /wp-admin/index.php?page=buoy_activate_alert3.4842.31
Add New /wp-admin/post-new.php?post_type=buoy_team3.5563.09
Safety information /wp-admin/edit.php?post_type=buoy_team&page=buoy_safety_info3.4451.32

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Buoy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20513.20 ▼1.551.58 ▼0.3341.09 ▼3.37
Dashboard /wp-admin2,351 ▲1604.91 ▼0.95114.33 ▲6.6043.34 ▲1.69
Posts /wp-admin/edit.php2,162 ▲732.00 ▼0.0236.91 ▼6.0329.01 ▼5.80
Add New Post /wp-admin/post-new.php1,587 ▲6823.20 ▼0.11646.07 ▼6.8057.10 ▼3.86
Media Library /wp-admin/upload.php1,461 ▲734.19 ▼0.00100.22 ▼6.1845.20 ▲0.12
Team membership /wp-admin/edit.php?post_type=buoy_team&page=buoy_team_membership9591.6829.1831.50
Buoy /wp-admin/options-general.php?page=buoy_settings1,8737.02137.1076.08
Respond to Alert /wp-admin/admin.php?page=buoy_review_alert8903.0048.8630.56
All Teams /wp-admin/edit.php?post_type=buoy_team1,2081.9830.4131.34
Incident Chat /wp-admin/admin.php?page=buoy_chat8472.9651.5920.27
Activate Alert /wp-admin/index.php?page=buoy_activate_alert8942.9638.4824.27
Add New /wp-admin/post-new.php?post_type=buoy_team1,7282.6149.9653.14
Safety information /wp-admin/edit.php?post_type=buoy_team&page=buoy_safety_info9982.0621.9527.18

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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/buoy/uninstall.php+35
    Undefined property: WP_Buoy_User_Settings::$default
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=buoy_chat
    • > Notice in wp-content/plugins/buoy/includes/class-buoy-alert.php+881
    Undefined index: buoy_hash

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 222× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Translation' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Translation/Horde/Translation/Autodetect.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/buoy/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Stream' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Stream/Horde/Stream/Temp.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/buoy/vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Imap_Client_Data_Format' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Data/Format/Atom.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Db_Migration_Base' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Imap_Client/data/migration/1_horde_imap_client_base_tables.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Imap_Client_Socket_Connection_Base' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket/Connection/Socket.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Imap_Client_Data_Format_List' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Interaction/Client.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/buoy/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Horde_Exception_Wrapped' not found in wp-content/plugins/buoy/vendor/pear-pear.horde.org/Horde_Mime/Horde/Mime/Exception.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
3 plugin tags: activism, emergency response, community

buoy/buoy.php 85% from 13 tests

The principal PHP file in "Buoy" v. 0.3.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 418 characters long)
  • Requires at least: Required version number should use periods and dots only (ex. "7.0" instead of "([0-9.]+)$/', $line, $m);")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin53,154 lines of code in 521 files:
LanguageFilesBlank linesComment linesLines of code
PHP3576,62122,31434,118
JavaScript122,3231,0107,253
PO File1062,3333,0997,118
Markdown1738201,270
CSS9136501,168
SVG3121,061
JSON900940
Bourne Shell121685
XML32054
YAML213049
HTML10030
Expect10128

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity16.37
▷ Minimum class complexity1.00
▷ Maximum class complexity740.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces5
Interfaces7
Traits0
Classes324
▷ Abstract classes123.70%
▷ Concrete classes31296.30%
▷ Final classes00.00%
Methods2,031
▷ Static methods26112.85%
▷ Public methods1,54476.02%
▷ Protected methods44822.06%
▷ Private methods391.92%
Functions26
▷ Named functions415.38%
▷ Anonymous functions2284.62%
Constants266
▷ Global constants10.38%
▷ Class constants26599.62%
▷ Public constants265100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/leaflet/dist/images/layers.png1.47KB1.05KB▼ 28.36%
vendor/leaflet/dist/images/marker-shadow.png0.78KB1.16KB0.00%
vendor/leaflet/dist/images/marker-icon-2x.png3.94KB2.53KB▼ 35.71%
img/apple-touch-icon-152x152.png20.84KB12.29KB▼ 41.01%
vendor/leaflet/dist/images/marker-icon.png1.71KB1.56KB▼ 8.59%