84% wc-try-before-you-buy

Code Review | WC Try Before You Buy

WordPress plugin WC Try Before You Buy scored84%from 54 tests.

About plugin

  • Plugin page: wc-try-before-you...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.0
  • WordPress version: 6.3.1
  • First release: Dec 16, 2018
  • Latest release: Dec 16, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: tahireu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /463 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.01ms] Passed 4 tests

An overview of server-side resources used by WC Try Before You Buy
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.39 ▼0.57
Dashboard /wp-admin3.31 ▲0.0049.75 ▼10.59
Posts /wp-admin/edit.php3.36 ▲0.0045.37 ▼9.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.45 ▼15.60
Media Library /wp-admin/upload.php3.23 ▲0.0039.44 ▼4.46

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WC Try Before You Buy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.30 ▼0.271.94 ▲0.3143.47 ▼1.11
Dashboard /wp-admin2,192 ▲125.58 ▼0.0890.35 ▼3.9942.83 ▼5.52
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0036.42 ▼2.1134.03 ▼8.26
Add New Post /wp-admin/post-new.php1,549 ▲1823.08 ▼0.10665.63 ▼130.7556.21 ▼0.75
Media Library /wp-admin/upload.php1,394 ▼94.29 ▲0.14100.06 ▼19.8441.69 ▼9.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-try-before-you-buy/includes/class-tbyb-activator.php
    • > /wp-content/plugins/wc-try-before-you-buy/wc-try-before-you-buy.php
    • > /wp-content/plugins/wc-try-before-you-buy/admin/class-tbyb-admin.php
    • > /wp-content/plugins/wc-try-before-you-buy/public/class-tbyb-public.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: try-before-you-buy, woocommerce, webshop, e-shop, shop...

wc-try-before-you-buy/wc-try-before-you-buy.php 92% from 13 tests

Analyzing the main PHP file in "WC Try Before You Buy" version 1.0.1
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 192 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,191 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP6299212658
JavaScript36341269
CSS47610264

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods32100.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin