46% connect-profilepress-and-discord

Code Review | Connect ProfilePress and Discord

WordPress plugin Connect ProfilePress and Discord scored 46% from 54 tests.

About plugin

  • Plugin page: connect-profilepr...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2022
  • Latest release: Sep 6, 2023
  • Number of updates: 7
  • Update frequency: every 35.9 days
  • Top authors: expresstechsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 533 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.57MB] [CPU: ▼17.01ms] Passed 4 tests

An overview of server-side resources used by Connect ProfilePress and Discord
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.5358.16 ▲15.39
Dashboard /wp-admin4.52 ▲1.2139.25 ▼18.14
Posts /wp-admin/edit.php4.52 ▲1.1645.54 ▼5.79
Add New Post /wp-admin/post-new.php4.52 ▼1.3752.85 ▼49.96
Media Library /wp-admin/upload.php4.52 ▲1.2841.75 ▲5.84
Scheduled Actions /wp-admin/tools.php?page=action-scheduler4.5350.87
Discord Settings /wp-admin/admin.php?page=connect-profilepress-and-discord4.5245.98

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

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/connect-profilepress-and-discord/" and "wp-content/uploads/"
    • (new file) wp-content/fda84261-227f-4cd0-8fe4-7a769b74134eprofilepress_discord_api_logs.txt
Filesystem: 131 new files
Database: 4 new tables, 28 new options
New tables
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_actionscheduler_logs
wp_actionscheduler_groups
New WordPress options
ets_profilepress_discord_job_queue_batch_size
action_scheduler_hybrid_store_demarkation
schema-ActionScheduler_LoggerSchema
ets_profilepress_discord_purchase_message
ets_profilepress_discord_retry_failed_api
widget_recent-comments
ets_profilepress_discord_send_expired_dm
ets_profilepress_discord_send_purchase_dm
ets_profilepress_discord_connect_button_bg_color
can_compress_scripts
...

Browser metrics Passed 4 tests

Checking browser requirements for Connect ProfilePress and Discord
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1513.19 ▼0.191.76 ▼0.0739.96 ▼8.16
Dashboard /wp-admin2,210 ▲14.85 ▼0.01113.86 ▲9.3242.83 ▼2.18
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0241.47 ▲5.5535.67 ▼0.03
Add New Post /wp-admin/post-new.php1,537 ▼521.88 ▲3.53674.50 ▼66.9864.23 ▲0.52
Media Library /wp-admin/upload.php1,386 ▼54.31 ▲0.0697.88 ▼3.5742.89 ▼0.45
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2381.8128.6230.74
Discord Settings /wp-admin/admin.php?page=connect-profilepress-and-discord1,9953.1469.3756.69

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/connect-profilepress-and-discord/admin/class-connect-profilepress-and-discord-admin.php+132
    Use of undefined constant PPRESS_DASHBOARD_SETTINGS_SLUG - assumed 'PPRESS_DASHBOARD_SETTINGS_SLUG' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
    • wp_actionscheduler_actions
    • wp_actionscheduler_claims
  • This plugin did not uninstall successfully, leaving 28 options in the database
    • widget_recent-posts
    • action_scheduler_hybrid_store_demarkation
    • ets_profilepress_discord_loggedin_button_text
    • can_compress_scripts
    • ets_profilepress_discord_cancelled_message
    • action_scheduler_lock_async-request-runner
    • ets_profilepress_discord_disconnect_button_bg_color
    • widget_theysaidso_widget
    • ets_profilepress_discord_job_queue_batch_size
    • ets_profilepress_discord_uuid_file_name
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=connect-profilepress-and-discord
    • > Warning in wp-content/plugins/connect-profilepress-and-discord/admin/class-connect-profilepress-and-discord-admin.php+132
    Use of undefined constant PPRESS_DASHBOARD_SETTINGS_SLUG - assumed 'PPRESS_DASHBOARD_SETTINGS_SLUG' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/connect-profilepress-and-discord/public/partials/connect-profilepress-and-discord-public-display.php
  • 51× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connect-profilepress-and-discord/admin/partials/connect-profilepress-and-discord-admin-display.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_FinishedAction' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/actions/ActionScheduler_CanceledAction.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/actions/ActionScheduler_NullAction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_AdminView_Deprecated' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/ActionScheduler_AdminView.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connect-profilepress-and-discord/admin/partials/pages/connect-profilepress-discord-documentation.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/connect-profilepress-and-discord/includes/libraries/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/connect-profilepress-and-discord/admin/partials/pages/connect-profilepress-discord-application-details.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=connect-profilepress-and-discord
    • > Network (severe)
    var/www/wordpress/wp-content/plugins/connect-profilepress-and-discord/admin/images/ets-logo.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=connect-profilepress-and-discord
    • > Console-api (severe) in unknown
    /wp-content/plugins/connect-profilepress-and-discord/admin/js/connect-profilepress-and-discord-admin.js?ver=1.0.3 115:12 Object

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

connect-profilepress-and-discord/connect-profilepress-and-discord.php Passed 13 tests

The main PHP file in "Connect ProfilePress and Discord" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
110 characters long description:
Sell private access to your discord server, and assign discord roles as per the membership level of the users.

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
Everything looks great! No dangerous files found in this plugin9,636 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,9976,0388,501
CSS51320662
JavaScript53714372
Markdown337091
SVG10010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.66
▷ Minimum class complexity1.00
▷ Maximum class complexity164.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes84
▷ Abstract classes1517.86%
▷ Concrete classes6982.14%
▷ Final classes00.00%
Methods656
▷ Static methods7010.67%
▷ Public methods49275.00%
▷ Protected methods13620.73%
▷ Private methods284.27%
Functions55
▷ Named functions4785.45%
▷ Anonymous functions814.55%
Constants42
▷ Global constants921.43%
▷ Class constants3378.57%
▷ Public constants33100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in 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/ets-logo.png11.34KB7.55KB▼ 33.46%
admin/images/icon.png99.19KB44.08KB▼ 55.56%