94% registrations-for-woocommerce

Code Review | Registrations for WooCommerce

WordPress plugin Registrations for WooCommerce scored 94% from 54 tests.

About plugin

  • Plugin page: registrations-for...
  • Plugin version: 2.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.3
  • WordPress version: 5.8.1
  • First release: Apr 6, 2016
  • Latest release: Oct 12, 2019
  • Number of updates: 35
  • Update frequency: every 36.7 days
  • Top authors: AllysonSouza (85.71%)hastedesign (17.14%)

Code review

54 tests

User reviews

6 reviews

Install metrics

600+ active / 13,233 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼143.54ms] Passed 4 tests

A check of server-side resources used by Registrations for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1532.27 ▲12.76
Dashboard /wp-admin3.09 ▲0.0344.71 ▲2.54
Posts /wp-admin/edit.php3.14 ▲0.0341.90 ▲1.61
Add New Post /wp-admin/post-new.php5.45 ▲0.0182.87 ▼574.47
Media Library /wp-admin/upload.php3.04 ▲0.0327.61 ▼3.82

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 40 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Registrations for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,724 ▲11815.89 ▲0.337.49 ▼0.4348.40 ▲0.83
Dashboard /wp-admin2,994 ▲635.93 ▼0.19146.85 ▲5.13104.97 ▼1.36
Posts /wp-admin/edit.php2,762 ▲232.70 ▲0.0267.83 ▲4.2388.69 ▼0.23
Add New Post /wp-admin/post-new.php1,685 ▲18519.00 ▲0.18377.42 ▼1.54106.04 ▼7.74
Media Library /wp-admin/upload.php1,831 ▲275.02 ▲0.01146.40 ▼1.65126.89 ▲4.92

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | 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 take a closer look at the following
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/registrations-for-woocommerce/includes/class-wc-registrations-checkout.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/registrations-for-woocommerce/includes/woo-includes/class-wc-dependencies.php:15
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/registrations-for-woocommerce/includes/class-wc-registrations-checkout.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/registrations-for-woocommerce/includes/reports/class-wc-reports-manager.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function maybe_unserialize() in wp-content/plugins/registrations-for-woocommerce/includes/views/html-dates-view.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/registrations-for-woocommerce/includes/views/html-dates-variation-fields-view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/registrations-for-woocommerce/includes/class-wc-registrations-admin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/registrations-for-woocommerce/includes/class-wc-registrations-checkout.php:35
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/registrations-for-woocommerce/includes/views/html-dates-view.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/registrations-for-woocommerce/includes/class-wc-registrations-checkout.php on line 13

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

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: tickets, subscriptions, attendees, events, registrations...

registrations-for-woocommerce/registrations-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Registrations for WooCommerce" version 2.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.8.0" instead of "3.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,055 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP184007381,430
JavaScript26997296
PO File194124251
SVG19140
Markdown117038

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity17.64
▷ Minimum class complexity2.00
▷ Maximum class complexity45.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods76
▷ Static methods5167.11%
▷ Public methods76100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.50MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png64.15KB28.41KB▼ 55.72%
assets/banner-772x250.png24.70KB11.55KB▼ 53.24%
assets/banner-1544x500.png53.37KB23.80KB▼ 55.41%
assets/screenshot-3.png70.97KB31.55KB▼ 55.54%
assets/screenshot-6.png57.46KB26.02KB▼ 54.71%