84% samply

Code Review | Samply - WooCommerce Product Sample Solution

WordPress plugin Samply - WooCommerce Product Sample Solution scored84%from 54 tests.

About plugin

  • Plugin page: samply
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2022
  • Latest release: May 4, 2023
  • Number of updates: 24
  • Update frequency: every 11.7 days
  • Top authors: ourtechbro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /904 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼7.32ms] Passed 4 tests

An overview of server-side resources used by Samply - WooCommerce Product Sample Solution
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.29 ▼0.1718.52 ▼23.73
Dashboard /wp-admin3.62 ▲0.3255.39 ▲0.96
Posts /wp-admin/edit.php3.67 ▲0.3251.93 ▼0.06
Add New Post /wp-admin/post-new.php6.14 ▲0.2588.25 ▼6.44
Media Library /wp-admin/upload.php3.48 ▲0.2550.51 ▲18.86

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 153 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
samply_settings
widget_theysaidso_widget
samply_installed
widget_recent-posts
widget_recent-comments
db_upgraded
samply_version

Browser metrics Passed 4 tests

An overview of browser requirements for Samply - WooCommerce Product Sample Solution
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,600 ▼16114.31 ▼0.280.47 ▼1.2119.26 ▼29.02
Dashboard /wp-admin2,338 ▲1615.53 ▼0.0788.39 ▼10.5272.51 ▲26.86
Posts /wp-admin/edit.php2,255 ▲1522.03 ▲0.0137.05 ▼4.7334.06 ▼3.88
Add New Post /wp-admin/post-new.php1,683 ▲15722.96 ▼0.47750.75 ▲91.5269.57 ▲12.69
Media Library /wp-admin/upload.php1,549 ▲1464.10 ▼0.12114.36 ▲11.6482.91 ▲36.12

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • samply_settings
    • db_upgraded
    • widget_recent-posts
    • samply_version
    • samply_installed
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 59× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\VarDumper\\Cloner\\Stub' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Caster/EnumStub.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Cloner\\ClonerInterface' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Cloner/AbstractCloner.php:22
    • > PHP Fatal error
      Cannot use ::class with dynamic class name in wp-content/plugins/samply/vendor/symfony/var-dumper/Caster/CutStub.php on line 30
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\VarDumper\\Caster\\ConstStub' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Caster/ImgStub.php:17
    • > PHP Fatal error
      Cannot use ::class with dynamic class name in wp-content/plugins/samply/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php on line 24
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/samply/includes/Admin/views/fields/double-repeater.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\VarDumper\\Caster\\ConstStub' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Caster/LinkStub.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Dumper\\ContextProvider\\ContextProviderInterface' not found in wp-content/plugins/samply/vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php:19
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/samply/vendor/symfony/var-dumper/Caster/RedisCaster.php on line 105

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: free sample product, sample, woocommerce, product, ecommerce...

samply/samply.php Passed 13 tests

This is the main PHP file of "Samply - WooCommerce Product Sample Solution" version 1.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
98 characters long description:
An ultimate plugin to replicate an actual product with custom prices to order as a sample product.

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 plugin15,978 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172,0552,45512,621
CSS3279592,353
JSON600369
SVG902197
JavaScript34628194
PO File15874144
Markdown535092
YAML1308

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity17.58
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces18
Interfaces5
Traits2
Classes81
▷ Abstract classes22.47%
▷ Concrete classes7997.53%
▷ Final classes1012.66%
Methods452
▷ Static methods23451.77%
▷ Public methods38184.29%
▷ Protected methods214.65%
▷ Private methods5011.06%
Functions102
▷ Named functions9189.22%
▷ Anonymous functions1110.78%
Constants71
▷ Global constants1723.94%
▷ Class constants5476.06%
▷ Public constants3361.11%

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