10% wc-bayonet

Code Review | WC Bayonet

WordPress plugin WC Bayonet scored 10% from 54 tests.

About plugin

  • Plugin page: wc-bayonet
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Aug 9, 2017
  • Latest release: Aug 9, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: bayonetio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 527 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > User error in wp-content/plugins/wc-bayonet/wc-bayonet.php+34
    Please update all AnsPress extensions before activating.

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.60ms] Passed 4 tests

An overview of server-side resources used by WC Bayonet
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0125.04 ▼20.40
Dashboard /wp-admin3.35 ▲0.0447.74 ▲0.76
Posts /wp-admin/edit.php3.46 ▲0.1046.79 ▼3.09
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.94 ▼5.87
Media Library /wp-admin/upload.php3.27 ▲0.0435.94 ▼1.02
Bayonet Settings /wp-admin/admin.php?page=bayonet_settings_page3.1427.20

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 142 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
recovery_mode_email_last_sent
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WC Bayonet
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,483 ▼25213.21 ▼1.170.62 ▼1.4317.58 ▼24.56
Dashboard /wp-admin2,221 ▲365.84 ▼0.05103.34 ▼10.8141.42 ▼0.77
Posts /wp-admin/edit.php2,107 ▲212.05 ▲0.0635.64 ▼0.3933.37 ▼4.87
Add New Post /wp-admin/post-new.php1,527 ▲1317.73 ▲0.23631.25 ▼46.4773.23 ▲19.10
Media Library /wp-admin/upload.php1,400 ▲124.19 ▼0.0296.19 ▼3.0844.12 ▲0.18
Bayonet Settings /wp-admin/admin.php?page=bayonet_settings_page6831.536.4319.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=bayonet_settings_page
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/admin.php?page=bayonet_settings_page
    • > Error in wp-content/plugins/wc-bayonet/admin/partials/wc-bayonet-admin-settings-page.php+15
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/wc-bayonet/admin/partials/wc-bayonet-admin-settings-page.php:15
    Stack trace:
    #0 wp-content/plugins/wc-bayonet/admin/class-wc-bayonet-admin.php(125): require()
    #1 wp-includes/class-wp-hook.php(310): WC_Bayonet_Admin->display_settings_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
The following issues need your attention
  • 46× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/promises/src/RejectedPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/psr7/src/AppendStream.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/promises/src/Coroutine.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wc-bayonet/includes/class-wc-bayonet.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/psr7/src/NoSeekStream.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/psr7/src/PumpStream.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/guzzle/src/Exception/ClientException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/psr7/src/LimitStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/wc-bayonet/includes/src/guzzlehttp/psr7/src/ServerRequest.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wc-bayonet === )
The official readme.txt might help

wc-bayonet/wc-bayonet.php 92% from 13 tests

The entry point to "WC Bayonet" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 166 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected12,863 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,7605,3208,866
Markdown1093903,274
JSON800519
JavaScript2166899
PO File116245
YAML17034
CSS16617
make1409

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity12.76
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces9
Interfaces14
Traits2
Classes72
▷ Abstract classes00.00%
▷ Concrete classes72100.00%
▷ Final classes79.72%
Methods687
▷ Static methods8011.64%
▷ Public methods57283.26%
▷ Protected methods40.58%
▷ Private methods11116.16%
Functions149
▷ Named functions5738.26%
▷ Anonymous functions9261.74%
Constants47
▷ Global constants00.00%
▷ Class constants47100.00%
▷ Public constants47100.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
There were not PNG files found in your plugin