77% wpos-lite-version

Code Review | WPOS - A Lite version of OpenPOS - A Point Of Sales For Woocommerce

WordPress plugin WPOS - A Lite version of OpenPOS - A Point Of Sales For Woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: wpos-lite-version
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.6
  • WordPress version: 6.3.1
  • First release: Dec 24, 2020
  • Latest release: Dec 25, 2020
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: openpos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,622 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.49MB] [CPU: ▲8.99ms] Passed 4 tests

Server-side resources used by WPOS - A Lite version of OpenPOS - A Point Of Sales For Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.97 ▲1.5054.17 ▲15.04
Dashboard /wp-admin4.81 ▲1.5156.51 ▼1.72
Posts /wp-admin/edit.php4.86 ▲1.5162.09 ▲10.55
Add New Post /wp-admin/post-new.php7.33 ▲1.45115.75 ▲12.09
Media Library /wp-admin/upload.php4.74 ▲1.5153.48 ▲15.54

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 454 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WPOS - A Lite version of OpenPOS - A Point Of Sales For Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.53 ▼0.741.93 ▲0.2642.08 ▼1.88
Dashboard /wp-admin2,221 ▲185.86 ▲0.97104.73 ▼5.6639.97 ▼5.88
Posts /wp-admin/edit.php2,097 ▼32.01 ▼0.0339.69 ▲2.9434.98 ▼1.61
Add New Post /wp-admin/post-new.php1,545 ▲1423.56 ▲0.14662.07 ▼0.6653.21 ▼15.47
Media Library /wp-admin/upload.php1,403 ▲34.24 ▼0.0097.33 ▼10.5043.46 ▼5.85

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpos-lite-version/vendor/markbaker/complex/examples/complexTest.php
    • > /wp-content/plugins/wpos-lite-version/vendor/markbaker/complex/examples/testFunctions.php
    • > /wp-content/plugins/wpos-lite-version/vendor/markbaker/complex/examples/testOperations.php
  • 117× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheException' not found in wp-content/plugins/wpos-lite-version/vendor/psr/simple-cache/src/InvalidArgumentException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Dumper/QtFileDumper.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Tests/Dumper/PhpFileDumperTest.php:18
    • > PHP Notice
      Undefined variable: exchanges in wp-content/plugins/wpos-lite-version/templates/admin/woocommerce/order_exchanges.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Formatter\\MessageFormatterInterface' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Formatter/MessageFormatter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Loader/PoFileLoader.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Exceptions\\BarcodeException' not found in wp-content/plugins/wpos-lite-version/vendor/picqer/php-barcode-generator/src/Exceptions/InvalidCheckDigitException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Tests/TranslatorCacheTest.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Loader\\LoaderInterface' not found in wp-content/plugins/wpos-lite-version/vendor/symfony/translation/Loader/IcuResFileLoader.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: e-commerce, woocommerce pos, woocommerce, point of sale, woocommerce point of sale...

wpos-lite-version/index.php 77% from 13 tests

The entry point to "WPOS - A Lite version of OpenPOS - A Point Of Sales For Woocommerce" version 2.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("wpos-lite-version.php" instead of "index.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "2.6")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected58,136 lines of code in 389 files:
LanguageFilesBlank linesComment linesLines of code
PHP2935,36310,66629,647
CSS151,3105710,055
JavaScript161,2371,2825,948
XSD499764,991
PO File111,3251,6182,915
SVG4032,732
JSON1110922
Markdown101550526
XML1730342
HTML10032
YAML54015
Qt Linguist10010
INI1001

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 203)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity21.67
▷ Minimum class complexity1.00
▷ Maximum class complexity642.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity203.00
Code structure
Namespaces33
Interfaces17
Traits0
Classes147
▷ Abstract classes85.44%
▷ Concrete classes13994.56%
▷ Final classes10.72%
Methods1,409
▷ Static methods17512.42%
▷ Public methods1,20785.66%
▷ Protected methods1299.16%
▷ Private methods735.18%
Functions108
▷ Named functions8679.63%
▷ Anonymous functions2220.37%
Constants89
▷ Global constants55.62%
▷ Class constants8494.38%
▷ Public constants84100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_desc.png1.10KB0.25KB▼ 77.73%
assets/images/woocommerce.png4.83KB2.67KB▼ 44.64%
assets/images/print.png0.27KB0.24KB▼ 10.51%
assets/images/reset.png2.08KB1.78KB▼ 14.71%
assets/images/sort_both.png1.11KB0.29KB▼ 74.12%