84% wc-always-show-shipping-address

Code Review | WC always Show Shipping address

WordPress plugin WC always Show Shipping address scored 84% from 54 tests.

About plugin

  • Plugin page: wc-always-show-sh...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Jul 25, 2018
  • Latest release: Jul 25, 2018
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: Suyash87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 541 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.93ms] Passed 4 tests

A check of server-side resources used by WC always Show Shipping address
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.56 ▼3.77
Dashboard /wp-admin3.31 ▲0.0145.88 ▼3.55
Posts /wp-admin/edit.php3.36 ▲0.0146.77 ▼5.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.02 ▼9.46
Media Library /wp-admin/upload.php3.23 ▲0.0132.16 ▼5.27
WC Show Shipping address /wp-admin/options-general.php?page=wc_show_shipping_address3.2030.56

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WC always Show Shipping address
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.27 ▼1.104.87 ▲2.9140.45 ▼0.21
Dashboard /wp-admin2,204 ▲135.80 ▲0.9397.95 ▼7.7737.84 ▼6.97
Posts /wp-admin/edit.php2,093 ▲12.01 ▲0.0140.45 ▼0.2835.34 ▼1.72
Add New Post /wp-admin/post-new.php1,536 ▼623.37 ▲4.87628.26 ▲25.4055.58 ▼6.02
Media Library /wp-admin/upload.php1,389 ▲44.20 ▲0.0293.16 ▼4.8143.13 ▼0.56
WC Show Shipping address /wp-admin/options-general.php?page=wc_show_shipping_address7532.0523.4723.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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)
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-always-show-shipping-address/wc_show_shipping_address.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-always-show-shipping-address/wc_show_shipping_address.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (This is screen1, this is how your shipping address checkbox will always be clicked.)
You can look at the official readme.txt

wc-always-show-shipping-address/wc_show_shipping_address.php 92% from 13 tests

Analyzing the main PHP file in "WC always Show Shipping address" version 1.0
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-always-show-shipping-address.php" instead of "wc_show_shipping_address.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
Good job! No executable or dangerous file extensions detected24 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1101324

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin