88% civicrm-wp-profile-sync

Code Review | CiviCRM Profile Sync

WordPress plugin CiviCRM Profile Sync scored 88% from 54 tests.

About plugin

  • Plugin page: civicrm-wp-profil...
  • Plugin version: 0.5.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Jan 19, 2015
  • Latest release: Feb 8, 2022
  • Number of updates: 37
  • Update frequency: every 69.9 days
  • Top authors: needle (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 8,317 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼299.18ms] Passed 4 tests

Server-side resources used by CiviCRM Profile Sync
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0453.99 ▲0.94
Dashboard /wp-admin3.44 ▲0.0332.85 ▼0.16
Posts /wp-admin/edit.php3.67 ▲0.0337.06 ▲1.13
Add New Post /wp-admin/post-new.php6.91 ▼0.0691.04 ▼1,195.81
Media Library /wp-admin/upload.php3.32 ▲0.0324.56 ▼1.68

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 190 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CiviCRM Profile Sync
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4016.21 ▲0.135.70 ▼0.072.42 ▼0.02
Dashboard /wp-admin2,892 ▲386.08 ▼0.13119.16 ▼24.37154.58 ▼17.68
Posts /wp-admin/edit.php2,694 ▲33.24 ▼0.0067.01 ▲5.92142.07 ▲1.22
Add New Post /wp-admin/post-new.php1,711 ▼621.82 ▲0.28400.30 ▼34.43160.18 ▲3.04
Media Library /wp-admin/upload.php1,698 ▼05.51 ▼0.01141.99 ▲6.98187.15 ▲7.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/shortcodes/shortcode-address.php
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-groups-terms.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/taxonomies/term-participant-role-edit.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/pages/page-admin-acf-migrate.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-posts-participants.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/pages/page-admin-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-posts-activities.php:16
    • > PHP Notice
      Undefined variable: metabox in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-migrate-info.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/buddypress/metaboxes/metabox-bp-field-content.php:31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-migrate-info.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/civicrm-wp-profile-sync/assets/templates/wordpress/metaboxes/metabox-acf-participants-posts.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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
7 plugin tags: user, sync, civicrm, xprofile, buddypress...

civicrm-wp-profile-sync/civicrm-wp-profile-sync.php 92% from 13 tests

"CiviCRM Profile Sync" version 0.5.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 152 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin42,692 lines of code in 173 files:
LanguageFilesBlank linesComment linesLines of code
PHP14426,26445,60940,225
JavaScript215521,1231,155
CSS272102945
Markdown21930292
Smarty415675

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity48.42
▷ Minimum class complexity1.00
▷ Maximum class complexity310.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes121
▷ Abstract classes00.00%
▷ Concrete classes121100.00%
▷ Final classes00.00%
Methods2,026
▷ Static methods10.05%
▷ Public methods2,01999.65%
▷ Protected methods00.00%
▷ Private methods70.35%
Functions70
▷ Named functions5375.71%
▷ Anonymous functions1724.29%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/acf/manual-sync/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
assets/images/acf/manual-sync/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
assets/images/acf/manual-sync/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
assets/images/acf/manual-sync/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
assets/images/acf/manual-sync/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%