10% simple-product-badges

Code Review | Simple Product Badges

WordPress plugin Simple Product Badges scored10%from 54 tests.

About plugin

  • Plugin page: simple-product-ba...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 11, 2023
  • Latest release: Jul 11, 2023
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: alexgarciacat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /206 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > User error in wp-content/plugins/simple-product-badges/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16.

Server metrics [RAM: ▼1.92MB] [CPU: ▼51.83ms] Passed 4 tests

An overview of server-side resources used by Simple Product Badges
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.31 ▼38.99
Dashboard /wp-admin2.08 ▼1.226.09 ▼44.11
Posts /wp-admin/edit.php2.08 ▼1.276.75 ▼42.20
Add New Post /wp-admin/post-new.php2.08 ▼3.805.58 ▼82.00
Media Library /wp-admin/upload.php2.08 ▼1.146.42 ▼26.69

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2,225 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Product Badges
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,019 ▲26218.86 ▲4.111.97 ▼0.1138.57 ▼6.94
Dashboard /wp-admin2,402 ▲2149.31 ▲4.45201.07 ▲79.8738.04 ▼9.43
Posts /wp-admin/edit.php2,317 ▲2286.25 ▲4.2588.16 ▲50.5330.40 ▼4.17
Add New Post /wp-admin/post-new.php1,593 ▲5820.13 ▼3.16700.90 ▲14.7937.62 ▼18.34
Media Library /wp-admin/upload.php1,469 ▲876.64 ▲2.43109.74 ▲9.9841.16 ▼4.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User error in wp-content/plugins/simple-product-badges/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16.
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/simple-product-badges/simple-product-badges.php
    • > /wp-content/plugins/simple-product-badges/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 415× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/simple-product-badges/vendor/htmlburger/carbon-fields/core/Container/Nav_Menu_Item_Container.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' not found in wp-content/plugins/simple-product-badges/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/simple-product-badges/vendor/symfony/translation/Translator.php:34
    • > PHP Fatal error
      Trait 'Illuminate\\Support\\Traits\\Macroable' not found in wp-content/plugins/simple-product-badges/vendor/illuminate/collections/Arr.php on line 9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-product-badges/vendor/htmlburger/carbon-fields/templates/Container/user_meta.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Exception\\ExceptionInterface' not found in wp-content/plugins/simple-product-badges/vendor/symfony/translation/Exception/LogicException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\Doctrine\\DateTimeType' not found in wp-content/plugins/simple-product-badges/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/simple-product-badges/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Level_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Dumper\\DumperInterface' not found in wp-content/plugins/simple-product-badges/vendor/symfony/translation/Dumper/FileDumper.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\BadMethodCallException' not found in wp-content/plugins/simple-product-badges/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: simple, custom, woocomerce, badges, products

simple-product-badges/simple-product-badges.php Passed 13 tests

The main PHP file in "Simple Product Badges" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
Create simple customized badges for your store products in WooCommerce.

Code Analysis 5% from 3 tests

File types 0% from 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
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/simple-product-badges/vendor/nesbot/carbon/bin/carbon.bat
100,435 lines of code in 1,928 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,59215,46351,32070,153
JavaScript1807,10110,93016,320
JSON31003,094
XSD391482,842
PO File288981,1112,411
CSS92401,1572,255
Sass5337741,940
Markdown2851911,314
reStructuredText1747874
TypeScript14126
DOS Batch1004
YAML1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.65
▷ Minimum class complexity1.00
▷ Maximum class complexity323.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces125
Interfaces154
Traits64
Classes508
▷ Abstract classes367.09%
▷ Concrete classes47292.91%
▷ Final classes469.75%
Methods5,254
▷ Static methods79515.13%
▷ Public methods4,39083.56%
▷ Protected methods71213.55%
▷ Private methods1522.89%
Functions775
▷ Named functions16621.42%
▷ Anonymous functions60978.58%
Constants240
▷ Global constants187.50%
▷ Class constants22292.50%
▷ Public constants21697.30%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected