68% bayesianwitch

Code Review | BayesianWitch

WordPress plugin BayesianWitch scored68%from 54 tests.

About plugin

  • Plugin page: bayesianwitch
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 12, 2014
  • Latest release: Feb 12, 2014
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: stucchio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /952 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.88ms] Passed 4 tests

An overview of server-side resources used by BayesianWitch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.19 ▼39.24
Dashboard /wp-admin2.05 ▼1.265.46 ▼43.06
Posts /wp-admin/edit.php2.05 ▼1.315.57 ▼44.36
Add New Post /wp-admin/post-new.php2.05 ▼3.845.23 ▼92.87
Media Library /wp-admin/upload.php2.05 ▼1.186.22 ▼30.97
BayesianWitch /wp-admin/plugins.php?page=BayesianWitch2.055.50

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for BayesianWitch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10813.26 ▼1.421.84 ▼0.0243.06 ▼4.64
Dashboard /wp-admin2,223 ▲354.86 ▼0.00108.29 ▼0.8338.57 ▼4.50
Posts /wp-admin/edit.php2,102 ▲132.06 ▲0.0738.65 ▼1.2540.68 ▲7.84
Add New Post /wp-admin/post-new.php1,538 ▲1418.27 ▼4.73611.70 ▼54.0079.02 ▲26.27
Media Library /wp-admin/upload.php1,402 ▲174.19 ▼0.0994.72 ▼15.3445.27 ▼5.21
BayesianWitch /wp-admin/plugins.php?page=BayesianWitch8002.0324.5323.11

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the bw_wpautop_fix handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/plugins.php?page=BayesianWitch
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the bw_wpautop_fix handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/plugins.php?page=BayesianWitch
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the bw_wpautop_fix handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=BayesianWitch
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/bayesianwitch/main.php:30

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: ab testing, affiliate marketing, bandit algorithms

bayesianwitch/main.php 85% from 13 tests

The primary PHP file in "BayesianWitch" version 0.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please improve your description making it at least 10 characters long (currently 1 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bayesianwitch.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected533 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2658468
CSS28043
JavaScript10022

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity25.67
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods1852.94%
▷ Protected methods00.00%
▷ Private methods1647.06%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin