84% wc1c-main

Code Review | WC1C

WordPress plugin WC1C scored84%from 54 tests.

About plugin

  • Plugin page: wc1c-main
  • Plugin version: 0.22.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Aug 14, 2023
  • Number of updates: 29
  • Update frequency: every 8.1 days
  • Top authors: wc1c (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /3,661 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 gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼3.98ms] Passed 4 tests

Server-side resources used by WC1C
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2341.29 ▼3.00
Dashboard /wp-admin3.55 ▲0.2549.90 ▼2.08
Posts /wp-admin/edit.php3.66 ▲0.3153.83 ▲1.31
Add New Post /wp-admin/post-new.php6.13 ▲0.2588.40 ▼12.14
Media Library /wp-admin/upload.php3.48 ▲0.2543.90 ▲8.59

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WC1C
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.67 ▼0.051.80 ▼0.0141.08 ▼6.09
Dashboard /wp-admin2,192 ▲155.64 ▼0.0382.97 ▼7.5937.19 ▼4.79
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0136.63 ▼4.2035.39 ▼3.19
Add New Post /wp-admin/post-new.php1,526 ▼223.76 ▲0.60669.82 ▲37.1652.44 ▲3.39
Media Library /wp-admin/upload.php1,403 ▲34.30 ▲0.1396.35 ▼6.6143.12 ▲0.79

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • wc1c_wizard
    • wc1c_version_init
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 106× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\MailHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/wc1c-main/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Wc1c\\Cml\\Abstracts\\DataAbstract' not found in wp-content/plugins/wc1c-main/vendor/wc1c/cml/src/Entities/OffersPackage.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Processor\\MemoryProcessor' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/wc1c-main/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: 1, cml, ecommerce, wc1c, commerceml...

wc1c-main/wc1c-main.php 92% from 13 tests

The main PHP script in "WC1C" version 0.22.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.2" instead of "4.3")

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
Everything looks great! No dangerous files found in this plugin39,165 lines of code in 445 files:
LanguageFilesBlank linesComment linesLines of code
PHP4288,49219,96834,388
PO File11,2071,7113,655
Markdown111960563
JSON100534
JavaScript31624
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.58
▷ Minimum class complexity1.00
▷ Maximum class complexity642.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces82
Interfaces60
Traits24
Classes288
▷ Abstract classes3712.85%
▷ Concrete classes25187.15%
▷ Final classes4718.73%
Methods2,488
▷ Static methods963.86%
▷ Public methods2,10984.77%
▷ Protected methods2389.57%
▷ Private methods1415.67%
Functions31
▷ Named functions39.68%
▷ Anonymous functions2890.32%
Constants92
▷ Global constants44.35%
▷ Class constants8895.65%
▷ Public constants88100.00%

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
1 PNG file occupies 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/promo_logs.png51.29KB24.64KB▼ 51.97%