58% connect-restrictcontentpro-to-discord-addon

Code Review | Connect Restrict Content Pro to Discord AddOn

WordPress plugin Connect Restrict Content Pro to Discord AddOn scored 58% from 54 tests.

About plugin

  • Plugin page: connect-restrictc...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 27, 2022
  • Latest release: Sep 5, 2023
  • Number of updates: 12
  • Update frequency: every 21.0 days
  • Top authors: expresstechsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 713 total downloads

Benchmarks

Plugin footprint 47% 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 successfully, without throwing any errors or notices

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

An overview of server-side resources used by Connect Restrict Content Pro to Discord AddOn
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3140.54 ▼1.04
Dashboard /wp-admin3.60 ▲0.2948.62 ▼1.62
Posts /wp-admin/edit.php3.71 ▲0.3549.03 ▲1.09
Add New Post /wp-admin/post-new.php6.22 ▲0.3395.27 ▼4.32
Media Library /wp-admin/upload.php3.52 ▲0.2941.43 ▲6.22
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.6747.38
Discord Settings /wp-admin/admin.php?page=rcp-discord3.5941.73

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

A short overview of filesystem and database impact
Just a few items left to fix
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/connect-restrictcontentpro-to-discord-addon/" and "wp-content/uploads/"
    • (new file) wp-content/0f7bdec9-9bbc-42bf-9ecd-c2264994e89ediscord_api_logs.txt
Filesystem: 131 new files
Database: 4 new tables, 31 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_actions
wp_actionscheduler_claims
wp_actionscheduler_groups
New WordPress options
ets_restrictcontentpro_retry_api_count
ets_restrictcontentpro_discord_payment_failed
action_scheduler_hybrid_store_demarkation
ets_restrictcontentpro_discord_welcome_message
ets_restrictcontentpro_discord_send_membership_expired_dm
ets_restrictcontentpro_discord_send_welcome_dm
widget_recent-comments
db_upgraded
ets_restrictcontentpro_discord_job_queue_concurrency
ets_restrictcontentpro_discord_uuid_file_name
...

Browser metrics Passed 4 tests

An overview of browser requirements for Connect Restrict Content Pro to Discord AddOn
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.20 ▼1.461.77 ▲0.0638.01 ▼3.75
Dashboard /wp-admin2,210 ▲184.87 ▼0.13102.87 ▼8.1940.52 ▼2.83
Posts /wp-admin/edit.php2,090 ▲12.05 ▲0.0734.99 ▼3.7731.64 ▼1.44
Add New Post /wp-admin/post-new.php1,517 ▼2517.64 ▼0.53642.61 ▼7.4165.42 ▲5.01
Media Library /wp-admin/upload.php1,395 ▲74.22 ▲0.0297.31 ▼3.9642.03 ▲0.05
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2142.1724.1932.24
Discord Settings /wp-admin/admin.php?page=rcp-discord1,9153.0274.7768.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/uninstall.php+34
    Undefined index: plugin
  • Zombie tables detected upon uninstall: 4 tables
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
  • This plugin did not uninstall successfully, leaving 31 options in the database
    • action_scheduler_hybrid_store_demarkation
    • ets_restrictcontentpro_discord_payment_failed
    • ets_restrictcontentpro_discord_welcome_message
    • schema-ActionScheduler_LoggerSchema
    • action_scheduler_lock_async-request-runner
    • ets_restrictcontentpro_discord_connect_button_bg_color
    • ets_restrictcontentpro_discord_cancel_message
    • ets_restrictcontentpro_discord_disconnect_button_bg_color
    • theysaidso_admin_options
    • ets_restrictcontentpro_discord_send_welcome_dm
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/connect-restrictcontentpro-to-discord-addon/public/partials/restrictcontentpro-discord-addon-public-display.php
  • 51× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/ActionScheduler_QueueRunner.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Schedule_Deprecated' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\ActionMigrator' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/migration/DryRun_ActionMigrator.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/admin/partials/pages/restrictcontentpro-discord-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/actions/ActionScheduler_NullAction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_DBStore' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/connect-restrictcontentpro-to-discord-addon/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php:18

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 93% 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
7 plugin tags: hang out, discord role management, video chat, talk, discord...

connect-restrictcontentpro-to-discord-addon/restrictcontentpro-discord-addon.php 85% from 13 tests

"Connect Restrict Content Pro to Discord AddOn" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("connect-restrictcontentpro-to-discord-addon.php" instead of "restrictcontentpro-discord-addon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected9,248 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
PHP1031,8185,4118,197
CSS61216609
JavaScript62870341
Markdown337091
SVG10010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.45
▷ Minimum class complexity1.00
▷ Maximum class complexity265.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes83
▷ Abstract classes1518.07%
▷ Concrete classes6881.93%
▷ Final classes00.00%
Methods640
▷ Static methods6910.78%
▷ Public methods48475.62%
▷ Protected methods13220.62%
▷ Private methods243.75%
Functions44
▷ Named functions3784.09%
▷ Anonymous functions715.91%
Constants42
▷ Global constants921.43%
▷ Class constants3378.57%
▷ Public constants33100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icon.png99.19KB44.08KB▼ 55.56%
admin/images/ets-logo.png11.34KB7.55KB▼ 33.46%