72% integracao-rd-station

Code Review | RD Station

WordPress plugin RD Station scored72%from 54 tests.

About plugin

  • Plugin page: integracao-rd-sta...
  • Plugin version: 5.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 11, 2015
  • Latest release: Sep 19, 2023
  • Number of updates: 140
  • Update frequency: every 20.9 days
  • Top authors: rdstation (56.43%)Filipe Mateus do Nascimento (42.86%)wwwbruno (2.14%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20,000+ active /247,432 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.39MB] [CPU: ▼1.79ms] Passed 4 tests

Analyzing server-side resources used by RD Station
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3949.10 ▲7.18
Dashboard /wp-admin3.69 ▲0.3853.31 ▼11.79
Posts /wp-admin/edit.php3.74 ▲0.3856.09 ▲3.85
Add New Post /wp-admin/post-new.php6.29 ▲0.4190.74 ▼2.63
Media Library /wp-admin/upload.php3.61 ▲0.3842.18 ▲3.42
RD Station Settings /wp-admin/options-general.php?page=rdstation-settings-page3.5238.78

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 61 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

RD Station: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.28 ▼0.131.89 ▲0.0542.21 ▼4.64
Dashboard /wp-admin2,202 ▲255.64 ▼0.0391.09 ▼19.2439.92 ▼11.27
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0336.06 ▼0.2536.93 ▲1.10
Add New Post /wp-admin/post-new.php1,715 ▲18923.29 ▲0.17569.92 ▼144.1881.33 ▲27.73
Media Library /wp-admin/upload.php1,401 ▲44.23 ▼0.02104.47 ▼2.0942.98 ▼5.67
RD Station Settings /wp-admin/options-general.php?page=rdstation-settings-page8942.1238.2145.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/integracao-rd-station/includes/helpers/rdsm_log_file_helper.php+18
    file(wp-content/plugins/integracao-rd-station//log): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/integracao-rd-station/includes/events/rdsm_integration_form_woocommerce.php+19
    Undefined index: fields
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/integracao-rd-station/includes/events/rdsm_integration_form_woocommerce.php+20
    array_column() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/integracao-rd-station/includes/events/rdsm_integration_form_woocommerce.php+20
    array_multisort(): Argument #1 is expected to be an array or a sort flag
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/integracao-rd-station/includes/events/rdsm_integration_form_woocommerce.php+22
    Invalid argument supplied for foreach()

SRP 50% 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
Please take a closer look at the following
  • 73× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/integrations/rdsm_integrations.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/integrations/contact_form7/integration.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/integrations/rdsm_integrations.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/integrations/gravity_forms/integration.php on line 3
    • > PHP Warning
      require_once(RDSM_SRC_DIR/helpers/rdsm_log_file_helper.php): failed to open stream: No such file or directory in wp-content/plugins/integracao-rd-station/includes/client/rdsm_api.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/entities/rdsm_user_credentials.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/events/rdsm_oauth_connected.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/events/rdsm_events_interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/events/rdsm_settings_page_loaded.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/entities/rdsm_user_credentials.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/events/rdsm_tracking_status_updated.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RDSM_SRC_DIR/events/rdsm_events_interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/integracao-rd-station/includes/events/rdsm_oauth_disconnected.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'RDCustomPostType' not found in wp-content/plugins/integracao-rd-station/initializers/contact_form7.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/integracao-rd-station/settings/settings_menu.php:3
    • > PHP Warning
      require_once(RDSM_SRC_DIR/helpers/rdsm_log_file_helper.php): failed to open stream: No such file or directory in wp-content/plugins/integracao-rd-station/includes/client/rdsm_api.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > Javascript (severe) in unknown
    /wp-content/plugins/integracao-rd-station/assets/js/general_settings.js?ver=6.3.1 36:26 Uncaught TypeError: Cannot read properties of null (reading 'classList')
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > Javascript (severe) in unknown
    /wp-content/plugins/integracao-rd-station/assets/js/log_file.js?ver=6.3.1 13:13 Uncaught TypeError: data.forEach is not a function
    • > GET request to /wp-admin/options-general.php?page=rdstation-settings-page
    • > Javascript (severe) in unknown
    /wp-content/plugins/integracao-rd-station/assets/js/woocommerce_fields.js?ver=6.3.1 25:25 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: The official readme.txt is a good inspiration

integracao-rd-station/integracao-rd-station.php Passed 13 tests

"RD Station" version 5.3.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
66 characters long description:
Integre seus formulários de contato do WordPress com o RD Station

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
Good job! No executable or dangerous file extensions detected2,410 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP43379371,681
JavaScript6590418
CSS2361176
Markdown1920135

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.09
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods127
▷ Static methods1511.81%
▷ Public methods8869.29%
▷ Protected methods00.00%
▷ Private methods3930.71%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants1361.90%
▷ Class constants838.10%
▷ Public constants8100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 1.31MB with 0.79MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png436.05KB120.22KB▼ 72.43%
assets/icon-128x128.png2.67KB1.50KB▼ 43.77%
screenshot.png89.27KB33.91KB▼ 62.01%
assets/banner-772x250.png18.66KB9.09KB▼ 51.29%
assets/screenshot-1.png428.24KB117.22KB▼ 72.63%