56% rtbiz

Code Review | rtBiz

WordPress plugin rtBiz scored56%from 54 tests.

About plugin

  • Plugin page: rtbiz
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.9
  • WordPress version: 6.3.1
  • First release: Dec 22, 2014
  • Latest release: Feb 3, 2022
  • Number of updates: 110
  • Update frequency: every 23.7 days
  • Top authors: vaishu.agola27 (39.09%)rtcamp (38.18%)desaiuditd (21.82%)juhise (1.82%)bhargavbhandari90 (1.82%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,956 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.59MB] [CPU: ▲364.08ms] 50% from 4 tests

Server-side resources used by rtBiz
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 3,301.93ms on /wp-admin/admin.php?page=rtbiz-dashboard)
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 364.08ms on /wp-admin/admin.php?page=rtbiz-dashboard)
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.7358.67 ▲19.72
Dashboard /wp-admin3.92 ▲0.57525.06 ▲460.48
Posts /wp-admin/edit.php4.09 ▲0.73545.61 ▲495.91
Add New Post /wp-admin/post-new.php6.23 ▲0.35580.27 ▲480.19
Media Library /wp-admin/upload.php3.95 ▲0.72572.15 ▲527.50
Redux Framework /wp-admin/tools.php?page=redux-about3.90696.52
Settings /wp-admin/admin.php?page=rt-biz-settings4.53754.48
All Companies /wp-admin/edit.php?post_type=company4.04535.61
Access Control /wp-admin/admin.php?page=rtbiz-access-control3.903,221.97
Products /wp-admin/edit-tags.php?taxonomy=rt-product&post_type=contact3.933,301.64
Attributes /wp-admin/admin.php?page=rtbiz-attributes3.903,310.44
--- Teams /wp-admin/edit-tags.php?taxonomy=rt-team&post_type=contact3.933,304.70
All Contacts /wp-admin/edit.php?post_type=contact4.073,303.08
Dashboard /wp-admin/admin.php?page=rtbiz-dashboard3.913,301.93

Server storage [IO: ▲6.90MB] [DB: ▲0.08MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 887 new files
Database: 10 new tables, 16 new options
New tables
wp_p2p
wp_rt_wp_attributes
wp_rt_wp_mail_outbound
wp_p2pmeta
wp_rt_wp_rtlib_gravity_fields_mapping
wp_rt_wp_imap_server
wp_rt_wp_rtbiz_acl
wp_rt_wp_attributes_relationship
wp_rt_wp_mail_accounts
wp_rt_wp_mail_messageids
New WordPress options
RT_RTBIZ_DB_VERSIONS
widget_p2p
redux_biz_settings
can_compress_scripts
db_upgraded
rtbiz_taxonomy_metadata_migration_complete
p2p_storage
redux_biz_settings-transients
widget_theysaidso_widget
RT_RTLIB_DB_VERSIONS_RT_IMPORTER
...

Browser metrics Passed 4 tests

rtBiz: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲15513.66 ▼0.775.59 ▲3.5238.24 ▼6.54
Dashboard /wp-admin2,332 ▲1295.89 ▲1.0299.79 ▼7.3282.71 ▲39.44
Posts /wp-admin/edit.php2,167 ▲672.08 ▲0.0236.18 ▼0.9734.78 ▲0.22
Add New Post /wp-admin/post-new.php1,580 ▲3217.72 ▼5.45690.91 ▲4.5934.67 ▼17.69
Media Library /wp-admin/upload.php1,465 ▲624.37 ▲0.2198.12 ▼6.0372.00 ▲23.40
Redux Framework /wp-admin/tools.php?page=redux-about1,1603.7674.4678.24
Settings /wp-admin/admin.php?page=rt-biz-settings1,3802.7454.6980.53
All Companies /wp-admin/edit.php?post_type=company1,2011.9835.2332.66
Access Control /wp-admin/admin.php?page=rtbiz-access-control1,0391.8726.3234.41
Products /wp-admin/edit-tags.php?taxonomy=rt-product&post_type=contact1,3691.9430.0938.59
Attributes /wp-admin/admin.php?page=rtbiz-attributes1,0841.8627.9437.53
--- Teams /wp-admin/edit-tags.php?taxonomy=rt-team&post_type=contact1,3932.1331.8839.93
All Contacts /wp-admin/edit.php?post_type=contact1,1792.0335.7135.43
Dashboard /wp-admin/admin.php?page=rtbiz-dashboard1,2194.1666.0336.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 10 tables in the database
    • wp_rt_wp_rtlib_gravity_fields_mapping
    • wp_rt_wp_attributes_relationship
    • wp_p2p
    • wp_rt_wp_attributes
    • wp_rt_wp_mail_accounts
    • wp_rt_wp_imap_server
    • wp_rt_wp_rtbiz_acl
    • wp_p2pmeta
    • wp_rt_wp_mail_messageids
    • wp_rt_wp_mail_outbound
  • This plugin did not uninstall successfully, leaving 16 options in the database
    • widget_recent-posts
    • RT_RTLIB_DB_VERSIONS_RT_IMPORTER
    • RT_RTLIB_DB_VERSIONS_ATTRIBUTES
    • widget_recent-comments
    • rtbiz_taxonomy_metadata_migration_complete
    • RT_RTBIZ_DB_VERSIONS
    • p2p_storage
    • redux_biz_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 22 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rtbiz-dashboard
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/admin.php?page=rt-biz-settings
    • > Error in wp-includes/Requests/src/Exception/InvalidArgument.php+29
    Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in wp-includes/Requests/src/Exception/InvalidArgument.php:29
    Stack trace:
    #0 wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
    #1 wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
    #2 wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
    #3 wp-includes/http.php(150): WP_Http->request()
    #4 wp-content/plugins/rtbiz/vendor/redux/ReduxCore/inc/class.p.php(229): wp_remote_request()
    #5 wp-includes/class-wp-hook.php(310): Redux_P->proxy()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin-ajax.php(188): do_action()
    #9 {main}
    th
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=contact
    • > request to
    • > Notice in wp-content/plugins/rtbiz/vendor/redux/ReduxCore/inc/class.redux_helpers.php+69
    Undefined index: REMOTE_ADDR
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=contact
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/google-api-php-client/Google_Client.php
  • 208× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Mail\\Exception\\OutOfBoundsException' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/MailLib/Zend/Mail/Storage/Exception/OutOfBoundsException.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'themecheck' not found in wp-content/plugins/rtbiz/vendor/redux/ReduxCore/inc/themecheck/checks/embedded.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Mail\\Header\\HeaderInterface' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/MailLib/Zend/Mail/Header/UnstructuredInterface.php:15
    • > PHP Warning
      require_once(service/Google_Utils.php): failed to open stream: No such file or directory in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/google-api-php-client/auth/Google_OAuth2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Mail\\Header\\HeaderInterface' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/MailLib/Zend/Mail/Header/AbstractAddressList.php:18
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/rtbiz/vendor/redux/ReduxCore/templates/panel/footer.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Google_IO' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/google-api-php-client/io/Google_CurlIO.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'RT_WP_TestCase' not found in wp-content/plugins/rtbiz/lib/tests/tests/test-rt-db-model.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/google-api-php-client/contrib/Google_BigqueryService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Cache' not found in wp-content/plugins/rtbiz/lib/rt-mailbox/vendor/google-api-php-client/cache/Google_FileCache.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=rt-biz-settings
    • > Network (severe)
    wp-admin/admin-ajax.php?action=redux_p&nonce=0e731bfd79&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D0e731bfd79%26url%3D - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=rt-biz-settings
    • > Security (severe) in unknown
    /wp-admin/admin.php?page=rt-biz-settings - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=0e731bfd79&url=http%3A%2F%2Fads.reduxframework.com%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3D0e731bfd79%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: access control, user groups, email parsing, contacts, acl...

rtbiz/rtbiz.php 92% from 13 tests

Analyzing the main PHP file in "rtBiz" version 1.4.4
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin103,333 lines of code in 738 files:
LanguageFilesBlank linesComment linesLines of code
PHP48911,56729,25471,892
JavaScript923,3002,66916,888
Sass50643605,618
Markdown221,08502,761
CSS506622942,657
SVG100934
HTML21870766
LESS38279715
Bourne Shell119789390
Bourne Again Shell24724300
JSON1000198
YAML42216117
XML21097

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 184)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity827.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity184.00
Code structure
Namespaces32
Interfaces48
Traits1
Classes1,134
▷ Abstract classes282.47%
▷ Concrete classes1,10697.53%
▷ Final classes00.00%
Methods8,834
▷ Static methods3534.00%
▷ Public methods8,51896.42%
▷ Protected methods1912.16%
▷ Private methods1251.41%
Functions167
▷ Named functions14184.43%
▷ Anonymous functions2615.57%
Constants89
▷ Global constants910.11%
▷ Class constants8089.89%
▷ Public constants80100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
46 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/redux/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
lib/rt-importer/assets/img/ui-bg_glass_55_444444_1x400.png0.12KB0.16KB0.00%
vendor/redux/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/redux/ReduxCore/assets/img/3-col-portfolio.png1.00KB0.15KB▼ 85.27%
lib/rt-importer/assets/img/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%