68% sama-member-registration

Code Review | Sama member registration

WordPress plugin Sama member registration scored68%from 54 tests.

About plugin

  • Plugin page: sama-member-regis...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 21, 2023
  • Latest release: Mar 31, 2023
  • Number of updates: 10
  • Update frequency: every 7.0 days
  • Top authors: wapnishantha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /220 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.32MB] [CPU: ▲1.31ms] Passed 4 tests

A check of server-side resources used by Sama member registration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3242.21 ▲4.83
Dashboard /wp-admin3.68 ▲0.3346.27 ▼11.23
Posts /wp-admin/edit.php3.73 ▲0.3748.13 ▲4.48
Add New Post /wp-admin/post-new.php6.22 ▲0.3494.01 ▲7.64
Media Library /wp-admin/upload.php3.54 ▲0.3140.21 ▲7.17
Setting /wp-admin/admin.php?page=sama_settings3.7350.26
Members list /wp-admin/admin.php?page=sama_members3.5935.56
Dashboard /wp-admin/admin.php?page=sama_options3.5135.71

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 47 new files
Database: 2 new tables, 6 new options
New tables
wp_sama_members
wp_sama_members_subscription
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Sama member registration: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲23114.00 ▼0.387.62 ▲5.9538.24 ▼5.89
Dashboard /wp-admin2,244 ▲565.93 ▲0.05100.93 ▼11.4670.88 ▲32.44
Posts /wp-admin/edit.php2,136 ▲472.22 ▲0.2033.92 ▼4.1929.71 ▼3.73
Add New Post /wp-admin/post-new.php1,721 ▲20725.17 ▲7.64697.80 ▼4.2932.76 ▼24.71
Media Library /wp-admin/upload.php1,505 ▲1174.33 ▲0.12104.58 ▲3.9883.05 ▲34.71
Setting /wp-admin/admin.php?page=sama_settings5,75917.90510.86182.13
Members list /wp-admin/admin.php?page=sama_members9161.8125.8523.92
Dashboard /wp-admin/admin.php?page=sama_options1,0491.9727.0029.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_sama_members
    • wp_sama_members_subscription
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 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
Please fix the following
  • 9× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sama-member-registration/deactivate.php
    • > /wp-content/plugins/sama-member-registration/views/accept-membership.php
    • > /wp-content/plugins/sama-member-registration/views/new-membership.php
    • > /wp-content/plugins/sama-member-registration/views/reject-membership.php
    • > /wp-content/plugins/sama-member-registration/views/dashboard-payment.php
    • > /wp-content/plugins/sama-member-registration/views/membership-expire-soon.php
    • > /wp-content/plugins/sama-member-registration/activate.php
    • > /wp-content/plugins/sama-member-registration/views/payment-pending-membership.php
    • > /wp-content/plugins/sama-member-registration/views/suspend-membership.php
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: suspend_members in wp-content/plugins/sama-member-registration/views/suspend-membership.php on line 13
    • > PHP Notice
      Undefined variable: reject_members in wp-content/plugins/sama-member-registration/views/reject-membership.php on line 12
    • > PHP Notice
      Undefined variable: subscriptions in wp-content/plugins/sama-member-registration/views/membership-expire-soon.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sama-member-registration/controllers/class-sama-registers.php:29
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sama-member-registration/views/payment-pending-membership.php on line 13
    • > PHP Notice
      Undefined variable: pending_members in wp-content/plugins/sama-member-registration/views/payment-pending-membership.php on line 13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sama-member-registration/views/accept-membership.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sama-member-registration/models/class-sama-cron.php:8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sama-member-registration/views/new-membership.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/sama-member-registration/samagikaya.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: membership, user profile, registration, registration form, login form...

sama-member-registration/samagikaya.php 92% from 13 tests

The main PHP file in "Sama member registration" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("sama-member-registration.php" instead of "samagikaya.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin6,351 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP307261693,143
SVG1002,671
CSS34911277
JavaScript25022200
Markdown122048
YAML13412

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity12.40
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods71
▷ Static methods3549.30%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png2.11KB0.43KB▼ 79.36%