77% connector-civicrm-mcrestface

Code Review | Connector to CiviCRM with CiviMcRestFace

WordPress plugin Connector to CiviCRM with CiviMcRestFace scored 77% from 54 tests.

About plugin

  • Plugin page: connector-civicrm...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.6
  • WordPress version: 6.3.1
  • First release: Dec 31, 2020
  • Latest release: Feb 3, 2022
  • Number of updates: 15
  • Update frequency: every 26.7 days
  • Top authors: jaapjansma (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,156 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲1.05ms] Passed 4 tests

Analyzing server-side resources used by Connector to CiviCRM with CiviMcRestFace
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2638.61 ▼2.00
Dashboard /wp-admin3.61 ▲0.3050.17 ▲2.12
Posts /wp-admin/edit.php3.66 ▲0.3050.66 ▲0.70
Add New Post /wp-admin/post-new.php6.19 ▲0.3098.58 ▲6.12
Media Library /wp-admin/upload.php3.53 ▲0.3038.89 ▲3.36
CiviCRM McRestFace Log /wp-admin/options-general.php?page=wpcmrf_calllog3.4335.44
CiviCRM McRestFace Connections /wp-admin/options-general.php?page=wpcmrf_admin3.4334.57

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 37 new files
Database: 2 new tables, 7 new options
New tables
wp_wpcmrf_core_call
wp_wpcivimrf_profile
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
wpcmrf_version

Browser metrics Passed 4 tests

Connector to CiviCRM with CiviMcRestFace: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.60 ▼1.011.56 ▼0.7540.03 ▼6.41
Dashboard /wp-admin2,211 ▲204.86 ▼0.04107.60 ▲4.1246.45 ▲4.52
Posts /wp-admin/edit.php2,097 ▲52.00 ▲0.0040.67 ▲0.5534.43 ▼3.18
Add New Post /wp-admin/post-new.php1,520 ▼123.66 ▲0.30593.87 ▼83.7152.68 ▼5.09
Media Library /wp-admin/upload.php1,399 ▲114.18 ▼0.0197.38 ▼10.6044.17 ▼0.26
CiviCRM McRestFace Log /wp-admin/options-general.php?page=wpcmrf_calllog7892.0223.5125.26
CiviCRM McRestFace Connections /wp-admin/options-general.php?page=wpcmrf_admin7802.1526.8725.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/connector-civicrm-mcrestface/wpcmrf.php
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connector-civicrm-mcrestface/views/calllog.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\Connection\\Curl' not found in wp-content/plugins/connector-civicrm-mcrestface/CMRF/Wordpress/Connection/Curl.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connector-civicrm-mcrestface/views/form.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\PersistenceLayer\\CallFactory' not found in wp-content/plugins/connector-civicrm-mcrestface/vendor/civimrf/cmrf_abstract_core/CMRF/PersistenceLayer/SQLPersistingCallFactory.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\Core\\Connection' not found in wp-content/plugins/connector-civicrm-mcrestface/vendor/civimrf/cmrf_abstract_core/CMRF/Connection/Local.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\Core\\AbstractCall' not found in wp-content/plugins/connector-civicrm-mcrestface/CMRF/Wordpress/Call.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\Connection\\Local' not found in wp-content/plugins/connector-civicrm-mcrestface/CMRF/Wordpress/Connection/Local.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'CMRF\\Core\\Connection' not found in wp-content/plugins/connector-civicrm-mcrestface/vendor/civimrf/cmrf_abstract_core/CMRF/Connection/CurlAuthX.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connector-civicrm-mcrestface/views/profiles.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'CMRF\\Core\\Call' not found in wp-content/plugins/connector-civicrm-mcrestface/vendor/civimrf/cmrf_abstract_core/CMRF/Core/AbstractCall.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
4 plugin tags: civicrm, connector, rest, api

connector-civicrm-mcrestface/wpcmrf.php 69% from 13 tests

The main PHP script in "Connector to CiviCRM with CiviMcRestFace" version 1.0.7 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("connector-civicrm-mcrestface.php" instead of "wpcmrf.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: Please don't use more than 140 characters for the plugin description (currently 207 characters long)
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,935 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP294686971,878
JSON30057

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.63
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes18
▷ Abstract classes316.67%
▷ Concrete classes1583.33%
▷ Final classes00.00%
Methods195
▷ Static methods2814.36%
▷ Public methods17187.69%
▷ Protected methods2110.77%
▷ Private methods31.54%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin