72% cm-invitation-codes

Code Review | Custom User Registration and Login Form

WordPress plugin Custom User Registration and Login Form scored 72% from 54 tests.

About plugin

  • Plugin page: cm-invitation-codes
  • Plugin version: 2.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 22, 2012
  • Latest release: Sep 10, 2023
  • Number of updates: 204
  • Update frequency: every 19.3 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active / 25,128 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.40MB] [CPU: ▼3.74ms] 75% from 4 tests

An overview of server-side resources used by Custom User Registration and Login Form
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 998.76ms on /wp-admin/admin.php?page=cm-registration)
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4539.65 ▼1.50
Dashboard /wp-admin3.74 ▲0.4449.28 ▼4.17
Posts /wp-admin/edit.php3.79 ▲0.4449.40 ▲1.59
Add New Post /wp-admin/post-new.php6.26 ▲0.3782.81 ▼10.88
Media Library /wp-admin/upload.php3.60 ▲0.3737.53 ▲2.35
CM Registration /wp-admin/admin.php?page=cm-registration3.88998.76
User Guide /wp-admin/admin.php?page=cmreg_about3.73466.76
Upgrade ➤ /wp-admin/admin.php?page=cmreg_pro3.6338.27
Shortcodes /wp-admin/admin.php?page=cm-registration-shortcodes3.6132.77

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 147 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
cmreg_update_methods
theysaidso_admin_options
widget_cmreg_loginformwidget
widget_recent-comments
db_upgraded
cmregplugin_error
widget_cmreg_registrationformwidget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom User Registration and Login Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲21714.01 ▼0.4610.89 ▲9.0938.33 ▼5.85
Dashboard /wp-admin2,243 ▲525.84 ▲0.9597.71 ▼5.4940.83 ▼3.52
Posts /wp-admin/edit.php2,129 ▲402.02 ▼0.1538.95 ▼1.0237.76 ▲5.09
Add New Post /wp-admin/post-new.php1,567 ▲5318.38 ▲0.76590.80 ▼10.0765.92 ▲11.13
Media Library /wp-admin/upload.php1,422 ▲404.20 ▲0.02105.46 ▲8.9950.31 ▲5.38
CM Registration /wp-admin/admin.php?page=cm-registration2,3587.7860.3982.64
User Guide /wp-admin/admin.php?page=cmreg_about4,05921.98446.03224.93
Upgrade ➤ /wp-admin/admin.php?page=cmreg_pro1,9322.0635.8945.36
Shortcodes /wp-admin/admin.php?page=cm-registration-shortcodes1,1992.0626.5449.03

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-comments
    • widget_cmreg_registrationformwidget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • cmreg_update_methods
    • cmregplugin_error
    • widget_cmreg_loginformwidget
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/cm-invitation-codes/view/backend/settings/shortcodes.php
    • > /wp-content/plugins/cm-invitation-codes/view/backend/category/form-icon.php
    • > /wp-content/plugins/cm-invitation-codes/view/backend/settings/option-login-redirect-role.php
    • > /wp-content/plugins/cm-invitation-codes/view/backend/settings/free-shortcodes.php
  • 55× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\controller\\Controller' not found in wp-content/plugins/cm-invitation-codes/controller/FrontendController.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\controller\\Controller' not found in wp-content/plugins/cm-invitation-codes/controller/AddSettingsTabsController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\model\\Model' not found in wp-content/plugins/cm-invitation-codes/model/Labels.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/cm-invitation-codes/view/backend/template.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\model\\Model' not found in wp-content/plugins/cm-invitation-codes/core/model/User.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-invitation-codes/package/cminds-plugin-config.php:6
    • > PHP Notice
      Undefined variable: nonce in wp-content/plugins/cm-invitation-codes/view/backend/category/form-icon.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\controller\\Controller' not found in wp-content/plugins/cm-invitation-codes/controller/UpdateController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\model\\InvitationCode' not found in wp-content/plugins/cm-invitation-codes/view/backend/cmdm/invitation-code-edit-metabox.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\registration\\controller\\Controller' not found in wp-content/plugins/cm-invitation-codes/controller/SettingsController.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=cmreg_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmreg_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmreg_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/ys/r/uroBBE-t04u.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmreg_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/ys/r/uroBBE-t04u.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

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
5 plugin tags: registration, invitation code, register, invitation, login

cm-invitation-codes/cm-registration.php 92% from 13 tests

The main PHP script in "Custom User Registration and Login Form" version 2.4.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cm-invitation-codes.php" instead of "cm-registration.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected19,634 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,3521,3009,148
PHP701,9875178,387
CSS9223652,083
SVG10116

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity17.50
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes46
▷ Abstract classes919.57%
▷ Concrete classes3780.43%
▷ Final classes00.00%
Methods474
▷ Static methods25453.59%
▷ Public methods41787.97%
▷ Protected methods5712.03%
▷ Private methods00.00%
Functions10
▷ Named functions00.00%
▷ Anonymous functions10100.00%
Constants200
▷ Global constants10.50%
▷ Class constants19999.50%
▷ Public constants199100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
43 PNG files occupy 0.56MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/views/img/confetti.png2.77KB2.01KB▼ 27.65%
package/CMWPPluginssuite.png33.88KB12.59KB▼ 62.83%
package/views/img/Vector.png0.54KB0.43KB▼ 19.31%
package/views/popup.png24.92KB7.12KB▼ 71.43%
package/views/businessdir.png30.22KB8.77KB▼ 70.98%