64% pmpro-discord-add-on

Code Review | Connect Paid Memberships Pro to Discord

WordPress plugin Connect Paid Memberships Pro to Discord scored64%from 54 tests.

About plugin

  • Plugin page: pmpro-discord-add-on
  • Plugin version: 1.2.12
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Aug 18, 2021
  • Latest release: Sep 7, 2023
  • Number of updates: 68
  • Update frequency: every 11.0 days
  • Top authors: expresstechsoftware (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

900+ active /17,095 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.30MB] [CPU: ▲0.53ms] Passed 4 tests

A check of server-side resources used by Connect Paid Memberships Pro to Discord
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2950.88 ▲7.08
Dashboard /wp-admin3.60 ▲0.3054.72 ▼0.77
Posts /wp-admin/edit.php3.71 ▲0.3655.04 ▲0.78
Add New Post /wp-admin/post-new.php6.20 ▲0.3196.50 ▼4.99
Media Library /wp-admin/upload.php3.52 ▲0.2948.37 ▲14.52
Discord Settings /wp-admin/admin.php?page=discord-options3.5746.88
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.6649.18

Server storage [IO: ▲1.20MB] [DB: ▲0.01MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/pmpro-discord-add-on/" and "wp-content/uploads/"
    • (new file) wp-content/cd9c8118-ee16-4c94-b731-0c3913259165discord_api_logs.txt
Filesystem: 117 new files
Database: 4 new tables, 31 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_actionscheduler_actions
New WordPress options
ets_pmpro_discord_send_expiration_warning_dm
ets_pmpro_discord_expiration_warning_message
widget_theysaidso_widget
ets_pmpro_discord_btn_color
ets_pmpro_discord_loggedin_btn_text
ets_pmpro_discord_expiration_expired_message
widget_recent-comments
ets_pmpro_discord_job_queue_concurrency
ets_pmpro_discord_send_membership_cancel_dm
ets_pmpro_discord_uuid_file_name
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Connect Paid Memberships Pro to Discord
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.27 ▲0.021.91 ▲0.2944.48 ▲3.71
Dashboard /wp-admin2,201 ▲245.57 ▼0.0184.84 ▼2.5338.24 ▼3.16
Posts /wp-admin/edit.php2,106 ▲61.97 ▼0.0733.81 ▼5.2337.53 ▲0.53
Add New Post /wp-admin/post-new.php1,531 ▲523.32 ▲0.15660.08 ▼12.9053.60 ▲1.23
Media Library /wp-admin/upload.php1,406 ▲94.24 ▲0.02110.56 ▲9.1246.65 ▲0.65
Discord Settings /wp-admin/admin.php?page=discord-options1,8152.5962.0547.63
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2121.8126.4830.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/pmpro-discord-add-on/uninstall.php+11
    Undefined index: plugin
  • Zombie tables were found after uninstall: 4 tables
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
  • The uninstall procedure has failed, leaving 31 options in the database
    • widget_recent-posts
    • ets_pmpro_retry_failed_api
    • ets_pmpro_btn_disconnect_color
    • ets_pmpro_retry_api_count
    • action_scheduler_lock_async-request-runner
    • ets_pmpro_discord_job_queue_batch_size
    • ets_pmpro_disconnect_btn_text
    • ets_pmpro_discord_send_membership_cancel_dm
    • can_compress_scripts
    • ets_pmpro_discord_send_expiration_warning_dm
    • ...

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 53× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/pmpro-discord-add-on/includes/pages/get-support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Schedule_Deprecated' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/pmpro-discord-add-on/includes/pages/discord-role-level-map.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_LogEntry' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/ActionScheduler_NullLogEntry.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pmpro-discord-add-on/includes/classes/class-discord-api.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\ActionMigrator' not found in wp-content/plugins/pmpro-discord-add-on/libraries/action-scheduler/classes/migration/DryRun_ActionMigrator.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: discord role management, discord, memberships, hang out, friends...

pmpro-discord-add-on/pmpro-discord.php 92% from 13 tests

Analyzing the main PHP file in "Connect Paid Memberships Pro to Discord" version 1.2.12
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pmpro-discord-add-on.php" instead of "pmpro-discord.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 detected16,044 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
PHP961,7634,8268,142
JavaScript42,0981,9107,226
CSS3811511
Markdown3480165

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.76
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes80
▷ Abstract classes1518.75%
▷ Concrete classes6581.25%
▷ Final classes00.00%
Methods630
▷ Static methods6610.48%
▷ Public methods47675.56%
▷ Protected methods13220.95%
▷ Private methods223.49%
Functions38
▷ Named functions3181.58%
▷ Anonymous functions718.42%
Constants42
▷ Global constants1023.81%
▷ Class constants3276.19%
▷ Public constants32100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.30MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ets-logo.png11.34KB7.55KB▼ 33.46%
assets/images/user-original.png6.06KB3.05KB▼ 49.66%
assets/images/ravisoni.png278.09KB110.22KB▼ 60.36%
assets/images/icon.png11.19KB5.20KB▼ 53.58%