78% direct-checkout

Code Review | Direct Checkout

WordPress plugin Direct Checkout scored78%from 54 tests.

About plugin

  • Plugin page: direct-checkout
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 28, 2020
  • Latest release: Oct 28, 2020
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: trendytechprooffical (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /732 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 gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▲7.04ms] Passed 4 tests

Server-side resources used by Direct Checkout
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1147.76 ▲5.22
Dashboard /wp-admin3.39 ▲0.0955.04 ▲7.14
Posts /wp-admin/edit.php3.50 ▲0.1556.55 ▲6.79
Add New Post /wp-admin/post-new.php5.99 ▲0.10104.15 ▲9.00
Media Library /wp-admin/upload.php3.31 ▲0.0944.39 ▲9.25

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Direct Checkout
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17214.12 ▼0.265.71 ▲4.0842.68 ▼2.49
Dashboard /wp-admin2,228 ▲255.83 ▼0.0797.68 ▼4.5541.72 ▼1.24
Posts /wp-admin/edit.php2,106 ▲31.97 ▼0.0439.96 ▲3.1936.34 ▼0.83
Add New Post /wp-admin/post-new.php1,530 ▼1523.14 ▼0.20618.55 ▼55.0651.48 ▼6.51
Media Library /wp-admin/upload.php1,407 ▲74.28 ▲0.0898.80 ▼8.0444.51 ▼0.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/direct-checkout/admin/partials/direct-checkout-admin-display.php
    • > /wp-content/plugins/direct-checkout/public/partials/direct-checkout-public-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/direct-checkout/admin/partials/direct-checkout-admin-checkout-settings.php:19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/direct-checkout/admin/partials/direct-checkout-admin-sub-nav.php:3

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Requires php: Invalid version format
  • Requires at least: Invalid version format
Please take inspiration from this readme.txt

direct-checkout/direct-checkout.php Passed 13 tests

The main PHP script in "Direct Checkout" version 1.0.0 is automatically included on every request by WordPress
122 characters long description:
On an e-commerce website, a user can make a purchase via adding a product to the cart and proceeding on the checkout page.

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
There were no executable files found in this plugin932 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP15194608854
Markdown123038
CSS22834
JavaScript24546

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2781.82%
▷ Protected methods00.00%
▷ Private methods618.18%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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