83% oca-for-woocommerce

Code Review | OCA para WooCommerce

WordPress plugin OCA para WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: oca-for-woocommerce
  • Plugin version: 2.7.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2020
  • Latest release: Sep 15, 2023
  • Number of updates: 45
  • Update frequency: every 22.9 days
  • Top authors: crplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 2,817 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.83ms] Passed 4 tests

Analyzing server-side resources used by OCA para WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.50 ▼5.89
Dashboard /wp-admin3.31 ▲0.0046.06 ▼0.67
Posts /wp-admin/edit.php3.36 ▲0.0048.63 ▼0.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.09 ▼12.47
Media Library /wp-admin/upload.php3.23 ▲0.0036.75 ▲1.90

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for OCA para WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.131.70 ▼0.1242.83 ▲2.92
Dashboard /wp-admin2,209 ▲214.86 ▼0.0896.81 ▼2.0239.46 ▼5.03
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0635.99 ▼4.7831.19 ▼5.00
Add New Post /wp-admin/post-new.php1,514 ▼1017.83 ▼5.43635.26 ▼30.2372.50 ▲9.59
Media Library /wp-admin/upload.php1,388 ▲94.21 ▼0.0093.12 ▼6.6741.77 ▼3.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 50× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/Filter/Ascii85.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/Type/PdfArray.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\Tcpdf\\Fpdi' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/TcpdfFpdi.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/CrossReference/LineReader.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'CRPlugins\\Oca\\Settings\\Fields\\Field' not found in wp-content/plugins/oca-for-woocommerce/Settings/Fields/AjaxButtonField.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/CrossReference/FixedReader.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdfTpl' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/Fpdi.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/Filter/LzwException.php:16
    • > PHP Fatal error
      Trait 'CRPlugins\\Oca\\Helper\\StringsTrait' not found in wp-content/plugins/oca-for-woocommerce/Helper/WooCommerceTrait.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/oca-for-woocommerce/libs/fpdi/PdfParser/Type/PdfName.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

oca-for-woocommerce/woocommerce-oca.php 77% from 13 tests

"OCA para WooCommerce" version 2.7.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("oca-for-woocommerce.php" instead of "woocommerce-oca.php")
  • Requires at least: Required version number should use periods and dots only (ex. "7.0" instead of "4")

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
There were no executable files found in this plugin9,682 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP1091,7222,7909,109
PO File1191213553
SVG1009
JavaScript6006
CSS3003
Markdown1102

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.83
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces20
Interfaces5
Traits9
Classes93
▷ Abstract classes66.45%
▷ Concrete classes8793.55%
▷ Final classes89.20%
Methods586
▷ Static methods9416.04%
▷ Public methods47881.57%
▷ Protected methods10217.41%
▷ Private methods61.02%
Functions16
▷ Named functions00.00%
▷ Anonymous functions16100.00%
Constants44
▷ Global constants12.27%
▷ Class constants4397.73%
▷ Public constants4297.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/dist/img/logo.png3.11KB3.00KB▼ 3.48%