10% mg-member-control

Code Review | MG Member Control

WordPress plugin MG Member Control scored10%from 54 tests.

About plugin

  • Plugin page: mg-member-control
  • Plugin version: 1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Nov 21, 2017
  • Latest release: Nov 21, 2017
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: mariogiannini (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /712 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/mg-member-control/mg-member-ctrl.php+242
    Use of undefined constant mgmc_activation_hook - assumed 'mgmc_activation_hook' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.70MB] [CPU: ▼54.28ms] Passed 4 tests

Analyzing server-side resources used by MG Member Control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.39 ▼1.076.30 ▼36.38
Dashboard /wp-admin2.28 ▼1.036.86 ▼42.88
Posts /wp-admin/edit.php2.28 ▼1.087.79 ▼47.87
Add New Post /wp-admin/post-new.php2.28 ▼3.618.01 ▼89.99
Media Library /wp-admin/upload.php2.28 ▼0.957.21 ▼30.19
MG Member Control /wp-admin/options-general.php?page=mg_member_control2.289.33

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 17 new options
New WordPress options
mgmc_salt
widget_recent-posts
widget_recent-comments
mgmc_emailwelcomesubject
mgmc_installed
mgmc_emailvalidationsubject
mgmc_emailwelcome
widget_mgmc_widget
mgmc_emailvalidationcontent
db_upgraded
...

Browser metrics Passed 4 tests

MG Member Control: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲18813.92 ▼0.4910.17 ▲8.5041.11 ▼7.13
Dashboard /wp-admin2,199 ▲195.56 ▼0.0995.06 ▼3.4141.12 ▲0.04
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0139.26 ▲2.9736.37 ▼0.36
Add New Post /wp-admin/post-new.php1,531 ▲322.82 ▼0.37597.15 ▼52.0849.90 ▼7.50
Media Library /wp-admin/upload.php1,407 ▲44.24 ▼0.0495.89 ▼9.0942.76 ▼0.91
MG Member Control /wp-admin/options-general.php?page=mg_member_control1,1472.0825.5033.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/mg-member-control/mg-member-ctrl.php+242
    Use of undefined constant mgmc_activation_hook - assumed 'mgmc_activation_hook' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_mgmc_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=mg_member_control
    • > Warning in wp-content/plugins/mg-member-control/mg-member-ctrl.php+242
    Use of undefined constant mgmc_activation_hook - assumed 'mgmc_activation_hook' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=mg_member_control
    • > Notice in wp-content/plugins/mg-member-control/inc/mg-member-ctrl_admin.php+337
    Undefined variable: newuserroles

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: login, membership, appearance

mg-member-control/mg-member-ctrl.php 85% from 13 tests

The entry point to "MG Member Control" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mg-member-control.php" instead of "mg-member-ctrl.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,465 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5117211,377
JavaScript15081
CSS1007

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.00
▷ Minimum class complexity10.00
▷ Maximum class complexity18.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin