68% myshopkit-product-badges-wp

Code Review | WooCommerce Product Badges | Myshopkit

WordPress plugin WooCommerce Product Badges | Myshopkit scored68%from 54 tests.

About plugin

  • Plugin page: myshopkit-product...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Sep 14, 2022
  • Latest release: Oct 27, 2022
  • Number of updates: 9
  • Update frequency: every 4.8 days
  • Top authors: wiloke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /760 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
This plugin's installer ran successfully

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

Server-side resources used by WooCommerce Product Badges | Myshopkit
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.77 ▲2.72
Dashboard /wp-admin3.51 ▲0.1746.98 ▼9.62
Posts /wp-admin/edit.php3.56 ▲0.2143.29 ▼5.40
Add New Post /wp-admin/post-new.php6.06 ▲0.1781.15 ▼12.58
Media Library /wp-admin/upload.php3.37 ▲0.1438.15 ▲3.81
New Arrival /wp-admin/edit.php?post_type=mskmbwp_new_arrival3.4235.52
Manuals /wp-admin/edit.php?post_type=mskmbwp_manual3.4235.63
On Sale /wp-admin/edit.php?post_type=mskmbwp_on_sale3.4233.84
Add New /wp-admin/post-new.php?post_type=mskmbwp_manual3.5549.12
Add New /wp-admin/post-new.php?post_type=mskmbwp_out_of_stock3.5556.10
Add New /wp-admin/post-new.php?post_type=mskmbwp_on_sale3.5550.83
Add New /wp-admin/post-new.php?post_type=mskmbwp_new_arrival3.5547.48
Out Of Stock /wp-admin/edit.php?post_type=mskmbwp_out_of_stock3.4238.80

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 425 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
mskmbwp_auth
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Product Badges | Myshopkit
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,037 ▲29113.90 ▼0.8313.62 ▲11.9331.57 ▼9.23
Dashboard /wp-admin2,327 ▲1505.59 ▼0.0796.91 ▲5.8476.39 ▲36.49
Posts /wp-admin/edit.php2,251 ▲1542.01 ▲0.0739.17 ▲3.4038.42 ▲4.57
Add New Post /wp-admin/post-new.php1,650 ▲12420.94 ▼2.21698.95 ▼10.9652.52 ▼1.95
Media Library /wp-admin/upload.php1,547 ▲1473.99 ▼0.18111.09 ▲6.3977.43 ▲34.84
New Arrival /wp-admin/edit.php?post_type=mskmbwp_new_arrival1,2321.9433.4732.31
Manuals /wp-admin/edit.php?post_type=mskmbwp_manual1,2321.9635.3132.02
On Sale /wp-admin/edit.php?post_type=mskmbwp_on_sale1,2261.9433.3735.83
Add New /wp-admin/post-new.php?post_type=mskmbwp_manual2,3467.69167.41119.73
Add New /wp-admin/post-new.php?post_type=mskmbwp_out_of_stock2,3497.58159.15113.67
Add New /wp-admin/post-new.php?post_type=mskmbwp_on_sale2,3467.53161.49105.63
Add New /wp-admin/post-new.php?post_type=mskmbwp_new_arrival2,3467.57159.31120.82
Out Of Stock /wp-admin/edit.php?post_type=mskmbwp_out_of_stock1,2321.9434.1332.40

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/hello.php
    • > /wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/index.php
    • > /wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/wiloke.php
  • 204× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AUpload' not found in wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/components/Upload/ImageURLUpload.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MyShopKitMBWP\\DefaultBadge\\Services\\Post\\PostService' not found in wp-content/plugins/myshopkit-product-badges-wp/src/DefaultBadge/Services/Post/CreatePostService.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MyShopKitMBWP\\Product\\Controllers\\ProductController' not found in wp-content/plugins/myshopkit-product-badges-wp/src/Product/Product.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php on line 287
    • > PHP Fatal error
      Uncaught Error: Class 'MyShopKitMBWP\\DefaultBadge\\Services\\Post\\PostService' not found in wp-content/plugins/myshopkit-product-badges-wp/src/Automatic/Services/Post/CreatePostService.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'MyShopKitMBWP\\Automatic\\Services\\PostMeta\\PostMetaService' not found in wp-content/plugins/myshopkit-product-badges-wp/src/Automatic/Services/PostMeta/AddPostMetaService.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/vendor/symfony/console/Symfony/Component/Console/Tests/Output/StreamOutputTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'MyShopKitMBWP\\Automatic\\Shared\\IAutomaticState' not found in wp-content/plugins/myshopkit-product-badges-wp/src/Automatic/Shared/NewArrivalBadge.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WilokeCommandLine\\CommonController' not found in wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/src/SetupUpload.php:13

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: Please take inspiration from this readme.txt

myshopkit-product-badges-wp/myshopkit-product-badges-wp.php Passed 13 tests

The entry point to "WooCommerce Product Badges | Myshopkit" version 1.0.4 is a PHP file that has certain tags in its header comment area
80 characters long description:
Highlighting your product with 500+ pre-made badges and Boost Sales custom code.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/myshopkit-product-badges-wp/vendor/wilokecom/phpcli/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe
24,832 lines of code in 363 files:
LanguageFilesBlank linesComment linesLines of code
PHP2874,9169,83521,481
Markdown2441501,225
JSON2500697
JavaScript2236521
XML18250447
CSS430331
YAML2302126
SVG1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.36
▷ Minimum class complexity1.00
▷ Maximum class complexity227.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces57
Interfaces19
Traits20
Classes213
▷ Abstract classes104.69%
▷ Concrete classes20395.31%
▷ Final classes31.48%
Methods1,872
▷ Static methods37620.09%
▷ Public methods1,54382.43%
▷ Protected methods19010.15%
▷ Private methods1397.43%
Functions117
▷ Named functions4941.88%
▷ Anonymous functions6858.12%
Constants47
▷ Global constants817.02%
▷ Class constants3982.98%
▷ Public constants39100.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
PNG images were not found in this plugin