78% ns-custom-checkout-page-for-woocommerce

Code Review | NS Custom Checkout Page for WooCommerce

WordPress plugin NS Custom Checkout Page for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-custom-checkou...
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Nov 8, 2016
  • Latest release: Feb 8, 2022
  • Number of updates: 41
  • Update frequency: every 46.8 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,757 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.35ms] Passed 4 tests

Analyzing server-side resources used by NS Custom Checkout Page for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.13 ▲1.19
Dashboard /wp-admin3.40 ▲0.0648.91 ▼9.38
Posts /wp-admin/edit.php3.52 ▲0.1647.12 ▲2.04
Add New Post /wp-admin/post-new.php6.00 ▲0.1280.23 ▼20.09
Media Library /wp-admin/upload.php3.33 ▲0.1035.52 ▼1.11
/wp-admin/admin.php?page=plugineye2403.2931.20
Custom Checkout /wp-admin/admin.php?page=ns-custom-checkout-page-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php3.3134.50
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2731.56

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

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

Browser metrics Passed 4 tests

Checking browser requirements for NS Custom Checkout Page for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.10 ▼0.251.74 ▲0.0843.95 ▲3.67
Dashboard /wp-admin2,228 ▲485.56 ▼0.1684.35 ▲0.5967.12 ▲21.92
Posts /wp-admin/edit.php2,127 ▲271.98 ▼0.0134.51 ▲0.3833.64 ▼2.64
Add New Post /wp-admin/post-new.php1,553 ▲2722.99 ▼0.48724.51 ▲49.8366.46 ▲7.52
Media Library /wp-admin/upload.php1,430 ▲334.16 ▲0.0695.06 ▼17.3064.57 ▲19.27
/wp-admin/admin.php?page=plugineye2409152.0022.3923.05
Custom Checkout /wp-admin/admin.php?page=ns-custom-checkout-page-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php1,0192.0122.4929.53
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6911.126.7719.68

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-custom-checkout-page-for-woocommerce/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ns-custom-checkout-page-for-woocommerce/ns-admin-options/inc.php:26

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Settings Custom Chekout Page.), #2 (Graphics example before.), #3 (Graphics example after.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

ns-custom-checkout-page-for-woocommerce/ns-custom-checkout-page.php 92% from 13 tests

This is the main PHP file of "NS Custom Checkout Page for WooCommerce" version 1.2.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ns-custom-checkout-page-for-woocommerce.php" instead of "ns-custom-checkout-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,573 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS312811822
PHP1178181629
PO File1383994
JavaScript14028

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.24
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods526.32%
▷ Protected methods00.00%
▷ Private methods1473.68%
Functions16
▷ Named functions637.50%
▷ Anonymous functions1062.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
ns-admin-options/img/ns-theme-promo.png29.37KB8.96KB▼ 69.50%
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
screenshot-2.png22.00KB5.32KB▼ 75.82%
screenshot-1.png36.34KB8.36KB▼ 76.99%