84% crm-grc-contact-by-sg

Code Review | GRC Contact API for Sendinblue

WordPress plugin GRC Contact API for Sendinblue scored84%from 54 tests.

About plugin

  • Plugin page: crm-grc-contact-b...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: Jan 22, 2021
  • Latest release: Jan 25, 2021
  • Number of updates: 13
  • Update frequency: every 4.3 days
  • Top authors: sgendt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,321 total downloads

Benchmarks

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

Server metrics [RAM: ▲0.37MB] [CPU: ▲0.68ms] Passed 4 tests

Analyzing server-side resources used by GRC Contact API for Sendinblue
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3943.15 ▲1.35
Dashboard /wp-admin3.70 ▲0.4051.42 ▲0.15
Posts /wp-admin/edit.php3.75 ▲0.3946.28 ▼2.38
Add New Post /wp-admin/post-new.php6.24 ▲0.3699.77 ▲6.87
Media Library /wp-admin/upload.php3.56 ▲0.3339.87 ▲3.59
Logs API error /wp-admin/admin.php?page=crm-grc-contact-by-sg-error-logs3.5438.97
Les APIs /wp-admin/edit.php?post_type=grc_form_api3.6638.15
Logs API succès /wp-admin/admin.php?page=crm-grc-contact-by-sg-logs3.5435.95
Nouvelle API /wp-admin/post-new.php?post_type=grc_form_api3.6048.09
Configuration /wp-admin/admin.php?page=crm-grc-contact-by-sg-index3.5331.68

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 161 new files
Database: 1 new table, 7 new options
New tables
wp_crm_grc_contact_logs
New WordPress options
widget_recent-posts
widget_theysaidso_widget
activated_crm-grc-contact-by-sg
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for GRC Contact API for Sendinblue
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.35 ▼0.171.87 ▼0.8939.58 ▼5.73
Dashboard /wp-admin2,256 ▲765.67 ▲0.1082.04 ▼11.0475.90 ▲36.87
Posts /wp-admin/edit.php2,145 ▲452.09 ▲0.0638.35 ▲1.3238.04 ▼0.38
Add New Post /wp-admin/post-new.php1,562 ▲3623.00 ▼0.20688.85 ▲19.1353.73 ▼2.04
Media Library /wp-admin/upload.php1,436 ▲334.19 ▼0.01113.32 ▲10.6070.48 ▲20.31
Logs API error /wp-admin/admin.php?page=crm-grc-contact-by-sg-error-logs8351.9925.6527.61
Les APIs /wp-admin/edit.php?post_type=grc_form_api1,1151.9030.9328.44
Logs API succès /wp-admin/admin.php?page=crm-grc-contact-by-sg-logs8381.9924.2326.10
Nouvelle API /wp-admin/post-new.php?post_type=grc_form_api2,2652.5950.6862.01
Configuration /wp-admin/admin.php?page=crm-grc-contact-by-sg-index8722.0125.6526.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • activated_crm-grc-contact-by-sg

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/psr7/src/NoSeekStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function crmGrcContact\\plugin_basename() in wp-content/plugins/crm-grc-contact-by-sg/wp-crm-grc-contact.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/crm-grc-contact-by-sg/template/crm-grc-contact-by-sg-error-logs.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/crm-grc-contact-by-sg/vendor/guzzlehttp/psr7/src/AppendStream.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/crm-grc-contact-by-sg/template/part/crm-grc-contact-token-missing.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/crm-grc-contact-by-sg/template/crm-grc-contact-key-box.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
3 plugin tags: api, sendinblue, grc contact

crm-grc-contact-by-sg/wp-crm-grc-contact.php 85% from 13 tests

Analyzing the main PHP file in "GRC Contact API for Sendinblue" version 1.0.3
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("crm-grc-contact-by-sg.php" instead of "wp-crm-grc-contact.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin13,557 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP1222,0056,1779,430
Markdown121,13203,453
JSON800629
CSS10021
XML10015
make1409

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.72
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces13
Interfaces20
Traits3
Classes76
▷ Abstract classes11.32%
▷ Concrete classes7598.68%
▷ Final classes2026.67%
Methods760
▷ Static methods12516.45%
▷ Public methods62381.97%
▷ Protected methods162.11%
▷ Private methods12115.92%
Functions152
▷ Named functions5737.50%
▷ Anonymous functions9562.50%
Constants70
▷ Global constants710.00%
▷ Class constants6390.00%
▷ Public constants63100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png10.82KB4.60KB▼ 57.45%