84% wc-carta-docente

Code Review | WooCommerce Carta Docente

WordPress plugin WooCommerce Carta Docente scored84%from 54 tests.

About plugin

  • Plugin page: wc-carta-docente
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 5, 2018
  • Latest release: May 2, 2023
  • Number of updates: 32
  • Update frequency: every 55.1 days
  • Top authors: ghera74 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /4,158 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.38ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Carta Docente
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.62 ▲3.88
Dashboard /wp-admin3.32 ▲0.0249.07 ▲0.23
Posts /wp-admin/edit.php3.37 ▲0.0249.18 ▼4.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.38 ▼2.89
Media Library /wp-admin/upload.php3.24 ▲0.0235.54 ▼1.96

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Carta Docente: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.011.98 ▼0.2441.86 ▲1.05
Dashboard /wp-admin2,198 ▲215.62 ▼0.0382.13 ▼14.0341.48 ▼2.55
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0633.52 ▼11.5237.31 ▲2.82
Add New Post /wp-admin/post-new.php1,536 ▲818.33 ▼4.22605.12 ▼54.1675.39 ▲17.84
Media Library /wp-admin/upload.php1,400 ▼34.20 ▲0.0799.75 ▼23.2148.35 ▲0.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-carta-docente/wc-carta-docente.php:99
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wc-carta-docente/includes/class-wccd-admin.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wc-carta-docente/includes/ilghera-notice/class-ilghera-notice.php:214
    • > PHP Fatal error
      Uncaught Error: Class 'Ilghera_Notice' not found in wp-content/plugins/wc-carta-docente/includes/ilghera-notice/extension.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wc-carta-docente/includes/class-wccd-teacher-gateway.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-carta-docente/includes/class-wccd.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
7 plugin tags: shop, payment gateway, orders, woocommerce, e-commerce...

wc-carta-docente/wc-carta-docente.php 92% from 13 tests

The principal PHP file in "WooCommerce Carta Docente" v. 1.3.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,393 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP7443361816
CSS55819289
JavaScript35534177
XML100111

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity16.67
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods39
▷ Static methods410.26%
▷ Public methods3897.44%
▷ Protected methods00.00%
▷ Private methods12.56%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
12 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/tzCheckbox/img/tzine.png1.23KB0.82KB▼ 33.25%
js/tzCheckbox/jquery.tzCheckbox/background.png4.96KB2.59KB▼ 47.82%
images/remove-cat-hover.png0.46KB0.21KB▼ 54.08%
images/icon.png57.93KB25.73KB▼ 55.59%
js/tzCheckbox/img/line_bg.png0.26KB0.23KB▼ 9.16%