83% santucommerce

Code Review | SantuCommerce

WordPress plugin SantuCommerce scored83%from 54 tests.

About plugin

  • Plugin page: santucommerce
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Jul 5, 2018
  • Latest release: Jul 5, 2018
  • Number of updates: 17
  • Update frequency: every 9.1 days
  • Top authors: santucommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,099 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▲0.75ms] Passed 4 tests

An overview of server-side resources used by SantuCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2943.50 ▲2.60
Dashboard /wp-admin3.75 ▲0.4056.04 ▼9.13
Posts /wp-admin/edit.php3.84 ▲0.4857.82 ▲4.98
Add New Post /wp-admin/post-new.php6.88 ▲0.99114.53 ▲4.55
Media Library /wp-admin/upload.php3.70 ▲0.4745.68 ▲7.84

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 14 new options
New WordPress options
santu_show_help
santu_buy_now_product
db_upgraded
can_compress_scripts
santu_buy_now_links
widget_theysaidso_widget
widget_recent-comments
santu_sell_from_image
santu_buy_now_buttons
santu_select_button
...

Browser metrics Passed 4 tests

A check of browser resources used by SantuCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,491 ▲1,72013.50 ▼0.802.66 ▲0.7638.85 ▼1.07
Dashboard /wp-admin3,839 ▲1,6595.06 ▼0.62102.43 ▲13.7981.95 ▲30.20
Posts /wp-admin/edit.php3,759 ▲1,6592.45 ▲0.4239.54 ▲4.5952.12 ▲13.55
Add New Post /wp-admin/post-new.php16,267 ▲14,72227.95 ▲4.481,162.88 ▲474.2440.89 ▼17.51
Media Library /wp-admin/upload.php3,059 ▲1,6594.51 ▲0.29113.78 ▼2.2695.80 ▲48.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 14 options
    • santu_show_help
    • santu_signup_url
    • santu_buy_now_buttons
    • santu_buy_now_product
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • santu_select_button
    • santu_sell_from_image
    • ...

Smoke tests 75% 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 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/santucommerce/includes/image-mappping.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 80% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

santucommerce/santu-wp-ecommerce.php 62% from 13 tests

"SantuCommerce" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 159 characters long)
  • Domain Path: The domain path should use only dashes and lowercase characters ("lang/")
  • Domain Path: Prefix the domain path with a forward slash character ("/lang/")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("santucommerce.php" instead of "santu-wp-ecommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin6,198 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript85301764,283
PHP131072461,426
CSS17258479
JSON10010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity20.29
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods70
▷ Static methods2535.71%
▷ Public methods70100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/rm.png0.52KB0.54KB0.00%
img/logo.png2.15KB2.18KB0.00%
img/paste_image.png17.58KB0.36KB▼ 97.96%
img/373x70.png12.25KB7.09KB▼ 42.11%
img/g.png1.60KB0.62KB▼ 61.31%