58% momo-membership

Code Review | Wordpress Membership Plugin - MoMo Membership

WordPress plugin Wordpress Membership Plugin - MoMo Membership scored58%from 54 tests.

About plugin

  • Plugin page: momo-membership
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1+
  • WordPress version: 6.3.1
  • First release: Nov 17, 2021
  • Latest release: Nov 2, 2022
  • Number of updates: 58
  • Update frequency: every 6.0 days
  • Top authors: momothemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,039 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.09MB] [CPU: ▲19.65ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Membership Plugin - MoMo Membership
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.9372.16 ▲35.44
Dashboard /wp-admin4.60 ▲1.2967.88 ▲22.01
Posts /wp-admin/edit.php4.71 ▲1.3572.62 ▲26.67
Add New Post /wp-admin/post-new.php6.73 ▲0.85100.99 ▲7.25
Media Library /wp-admin/upload.php4.52 ▲1.2961.06 ▲22.68
Invoices /wp-admin/edit.php?post_type=mmtms-invoices4.5655.58
Settings /wp-admin/admin.php?page=mmtms4.6679.52
Members Activity /wp-admin/admin.php?page=mmtms-members-activity4.5056.36

Server storage [IO: ▲0.60MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 74 new files
Database: 3 new tables, 9 new options
New tables
wp_mmtms_members
wp_mmtms_member_session_time
wp_mmtms_member_activities
New WordPress options
mmtms_email_response_page
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
mmt_activity_db_version
can_compress_scripts
widget_mmtms_login_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Membership Plugin - MoMo Membership
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲20914.93 ▲0.578.40 ▲6.67104.68 ▲58.57
Dashboard /wp-admin2,243 ▲636.37 ▲0.77106.31 ▲21.0640.50 ▲0.53
Posts /wp-admin/edit.php2,159 ▲593.00 ▲1.0349.52 ▲14.6537.67 ▲1.76
Add New Post /wp-admin/post-new.php1,616 ▲8822.12 ▼0.88663.27 ▼6.9642.38 ▼9.22
Media Library /wp-admin/upload.php1,451 ▲485.81 ▲1.60105.78 ▲5.4444.10 ▼0.15
Invoices /wp-admin/edit.php?post_type=mmtms-invoices1,0763.1940.3628.72
Member Activity /wp-admin/admin.php?page=mmtms-members-activity#/member9383.0746.8778.47
Settings /wp-admin/admin.php?page=mmtms3,7876.63131.2349.83
Members Activity /wp-admin/admin.php?page=mmtms-members-activity9142.9641.7640.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/momo-membership/uninstall.php+12
    Trying to access array offset on value of type bool
  • Zombie tables were found after uninstall: 3 tables
    • wp_mmtms_members
    • wp_mmtms_member_session_time
    • wp_mmtms_member_activities
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • mmtms_email_response_page
    • widget_recent-comments
    • widget_mmtms_login_widget
    • mmt_activity_db_version
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/momo-membership/email/mmtms-email-footer.php
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/admin/class-mmtms-admin-cpt-invoices.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/momo-membership/includes/class-mmtms-shortcodes.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/admin/class-mmtms-admin-ajax-user.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/momo-membership/admin/admin-invoice.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/members-activity/class-mmt-members-activity-ajax.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/members-activity/class-mmt-members-database.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/admin/class-mmtms-admin-ajax-redirection.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/momo-membership/includes/archive-mmtms-invoices.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/admin/class-mmtms-admin-ajax-pages.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/momo-membership/admin/class-mmtms-admin-metaboxes.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #0, #0, #0 in momo-membership/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
You can take inspiration from this readme.txt

momo-membership/class-mmt-membership.php 92% from 13 tests

The principal PHP file in "Wordpress Membership Plugin - MoMo Membership" v. 1.1.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("momo-membership.php" instead of "class-mmt-membership.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin12,309 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP532281,4517,496
JavaScript34512,159
CSS4362321,747
PO File1318452669
JSON100196
SVG130042

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity19.60
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods251
▷ Static methods20.80%
▷ Public methods23794.42%
▷ Protected methods114.38%
▷ Private methods31.20%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/mrf-loading.png19.32KB1.22KB▼ 93.66%
assets/img/tr-loading.png14.65KB0.32KB▼ 97.79%
assets/img/admin-loading.png12.22KB0.95KB▼ 92.21%