83% simple-product-sample-for-woocommerce

Code Review | Simple Product Sample

WordPress plugin Simple Product Sample scored83%from 54 tests.

About plugin

  • Plugin page: simple-product-sa...
  • Plugin version: 2.3.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 21, 2021
  • Latest release: Nov 18, 2023
  • Number of updates: 75
  • Update frequency: every 13.4 days
  • Top authors: mcidesarrollo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /3,379 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.15ms] 75% from 4 tests

Server-side resources used by Simple Product Sample
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 586.71ms on /wp-admin/admin.php?page=simple-product-sample)
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.32 ▼2.38
Dashboard /wp-admin3.35 ▲0.0447.66 ▼0.27
Posts /wp-admin/edit.php3.40 ▲0.0450.89 ▲3.52
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.90 ▲2.28
Media Library /wp-admin/upload.php3.27 ▲0.0434.16 ▼0.23
Simple Product Sample /wp-admin/admin.php?page=simple-product-sample3.34586.71

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 31 new options
New WordPress options
mcisps_auth_premium
mcisps_font_weight
mcisps_version
mcisps_padding_bottom
mcisps_text_button
mcisps_font_size
mcisps_padding_left
widget_recent-comments
mcisps_border_width
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Product Sample
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4114.32 ▼0.001.94 ▼0.1841.50 ▼5.86
Dashboard /wp-admin2,203 ▲265.60 ▼0.0490.68 ▼0.6638.79 ▼4.28
Posts /wp-admin/edit.php2,112 ▲121.97 ▼0.0539.45 ▼5.4036.10 ▼0.43
Add New Post /wp-admin/post-new.php1,537 ▲823.20 ▼0.12666.90 ▲43.6851.90 ▼0.27
Media Library /wp-admin/upload.php1,414 ▲144.17 ▲0.02101.31 ▼1.4042.55 ▲1.20
Simple Product Sample /wp-admin/admin.php?page=simple-product-sample1,4742.0124.0839.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 31 options in the database
    • mcisps_border_color
    • mcisps_padding_right
    • mcisps_margin_top
    • mcisps_font_size
    • theysaidso_admin_options
    • mcisps_default_values
    • mcisps_delete_all_data
    • mcisps_max_samples
    • mcisps_margin_right
    • mcisps_version
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=simple-product-sample
    • > Notice in wp-content/plugins/simple-product-sample-for-woocommerce/admin/partials/get_options_panel.php+471
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=simple-product-sample
    • > Notice in wp-content/plugins/simple-product-sample-for-woocommerce/admin/partials/get_options_panel.php+471
    Trying to get property 'name' of non-object

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: order samples, product sample, product sample button, product samples, samples

simple-product-sample-for-woocommerce/simple-product-sample.php 77% from 13 tests

The primary PHP file in "Simple Product Sample" version 2.3.5 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 145 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-product-sample-for-woocommerce.php" instead of "simple-product-sample.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,354 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP203481141,722
CSS284317
PO File187120226
JavaScript3371989

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity15.29
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods81
▷ Static methods00.00%
▷ Public methods7997.53%
▷ Protected methods00.00%
▷ Private methods22.47%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
There were not PNG files found in your plugin