Plugin Directory

Changeset 3147635


Ignore:
Timestamp:
09/06/2024 03:10:25 PM (18 months ago)
Author:
needle
Message:

Release 0.5.2

Location:
bp-groups-civicrm-sync/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • bp-groups-civicrm-sync/trunk/assets/templates/wordpress/settings/metaboxes/metabox-settings-submit.php

    r3035828 r3147635  
    2525                 * Filters the "misc publishing actions" section.
    2626                 *
     27                 * Make sure that whatever is returned has been properly escaped.
     28                 *
    2729                 * @since 0.5.0
    2830                 *
    2931                 * @param string $misc_pub_section The text for the "misc publishing actions" section.
    3032                 */
    31                 echo apply_filters( $this->hook_prefix . '/settings/page/metabox/submit/misc_pub', $misc_pub_section );
     33                $misc_pub_section = apply_filters( $this->hook_prefix . '/settings/page/metabox/submit/misc_pub', $misc_pub_section );
     34
     35                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     36                echo $misc_pub_section;
    3237
    3338                ?>
  • bp-groups-civicrm-sync/trunk/assets/templates/wordpress/settings/pages/page-dashboard.php

    r3035828 r3147635  
    4545    ?>
    4646
     47    <?php /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>
    4748    <form method="post" id="<?php echo esc_attr( $this->form_id ); ?>" action="<?php echo $this->form_submit_url_get(); ?>">
    4849
     
    5657        <div id="dashboard-widgets-wrap">
    5758
    58             <div id="dashboard-widgets" class="metabox-holder<?php echo $columns_css; ?>">
     59            <div id="dashboard-widgets" class="metabox-holder<?php echo esc_attr( $columns_css ); ?>">
    5960
    6061                <div id="postbox-container-1" class="postbox-container">
  • bp-groups-civicrm-sync/trunk/assets/templates/wordpress/settings/pages/page-settings.php

    r3035828 r3147635  
    5656    ?>
    5757
     58    <?php /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>
    5859    <form method="post" id="<?php echo esc_attr( $this->form_id ); ?>" action="<?php echo $this->form_submit_url_get(); ?>">
    5960
     
    6465        <div id="poststuff">
    6566
    66             <div id="post-body" class="metabox-holder columns-<?php echo $columns; ?>">
     67            <div id="post-body" class="metabox-holder columns-<?php echo esc_attr( $columns ); ?>">
    6768
    6869                <!--<div id="post-body-content">
  • bp-groups-civicrm-sync/trunk/bp-groups-civicrm-sync.php

    r3069044 r3147635  
    11<?php
    22/**
    3  * Plugin Name: BP Groups CiviCRM Sync
    4  * Plugin URI: https://github.com/christianwach/bp-groups-civicrm-sync
     3 * BP Groups CiviCRM Sync
     4 *
     5 * Plugin Name:       BP Groups CiviCRM Sync
     6 * Description:       Enables two-way synchronisation between BuddyPress Groups and CiviCRM Groups.
     7 * Version:           0.5.2
     8 * Plugin URI:        https://github.com/christianwach/bp-groups-civicrm-sync
    59 * GitHub Plugin URI: https://github.com/christianwach/bp-groups-civicrm-sync
    6  * Description: Enables two-way synchronisation between BuddyPress Groups and CiviCRM Groups.
    7  * Author: Christian Wach
    8  * Version: 0.5.1
    9  * Author URI: https://haystack.co.uk
    10  * Text Domain: bp-groups-civicrm-sync
    11  * Domain Path: /languages
     10 * Author:            Christian Wach
     11 * Author URI:        https://haystack.co.uk
     12 * Requires at least: 4.9
     13 * Requires PHP:      7.4
     14 * License:           GPLv2 or later
     15 * License URI:       https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     16 * Text Domain:       bp-groups-civicrm-sync
     17 * Domain Path:       /languages
    1218 *
    1319 * @package BP_Groups_CiviCRM_Sync
     
    1824
    1925// Set our version here.
    20 define( 'BP_GROUPS_CIVICRM_SYNC_VERSION', '0.5.1' );
     26define( 'BP_GROUPS_CIVICRM_SYNC_VERSION', '0.5.2' );
    2127
    2228// Store reference to this file.
     
    118124        $this->include_files();
    119125        $this->setup_objects();
     126        $this->register_hooks();
    120127
    121128        /**
     
    195202    }
    196203
     204    /**
     205     * Registers hooks.
     206     *
     207     * @since 0.5.2
     208     */
     209    public function register_hooks() {
     210
     211        // Add links to settings page.
     212        add_filter( 'plugin_action_links', [ $this, 'action_links' ], 10, 2 );
     213
     214    }
     215
    197216    // -----------------------------------------------------------------------------------
    198217
     
    307326    }
    308327
     328    /**
     329     * Adds utility links to settings page.
     330     *
     331     * @since 0.1
     332     * @since 0.5.2 Moved into plugin class.
     333     *
     334     * @param array  $links The existing links array.
     335     * @param string $file The name of the plugin file.
     336     * @return array $links The modified links array.
     337     */
     338    public function action_links( $links, $file ) {
     339
     340        // Bail if not this plugin.
     341        if ( plugin_basename( dirname( __FILE__ ) . '/bp-groups-civicrm-sync.php' ) !== $file ) {
     342            return $links;
     343        }
     344
     345        // Add links only when CiviCRM is fully installed.
     346        if ( ! defined( 'CIVICRM_INSTALLED' ) || ! CIVICRM_INSTALLED ) {
     347            return $links;
     348        }
     349
     350        // Bail if CiviCRM plugin is not present.
     351        if ( ! function_exists( 'civi_wp' ) ) {
     352            return $links;
     353        }
     354
     355        // Bail if BuddyPress plugin is not present.
     356        if ( ! function_exists( 'buddypress' ) ) {
     357            return $links;
     358        }
     359
     360        // Add settings link if not network activated and not viewing network admin.
     361        $link    = add_query_arg( [ 'page' => 'bpgcs_settings' ], admin_url( 'admin.php' ) );
     362        $links[] = '<a href="' . esc_url( $link ) . '">' . esc_html__( 'Settings', 'bp-groups-civicrm-sync' ) . '</a>';
     363
     364        // Always add Paypal link.
     365        $paypal  = 'https://www.paypal.me/interactivist';
     366        $links[] = '<a href="' . esc_url( $paypal ) . '" target="_blank">' . __( 'Donate!', 'bp-groups-civicrm-sync' ) . '</a>';
     367
     368        // --<
     369        return $links;
     370
     371    }
     372
    309373}
    310374
     
    338402 * @see https://developer.wordpress.org/reference/functions/register_uninstall_hook/
    339403 */
    340 
    341 /**
    342  * Utility to add link to settings page.
    343  *
    344  * @since 0.1
    345  *
    346  * @param array $links The existing links array.
    347  * @param str   $file The name of the plugin file.
    348  * @return array $links The modified links array.
    349  */
    350 function bp_groups_civicrm_sync_plugin_action_links( $links, $file ) {
    351 
    352     // Add settings link.
    353     if ( plugin_basename( dirname( __FILE__ ) . '/bp-groups-civicrm-sync.php' === $file ) ) {
    354 
    355         // Is this Network Admin?
    356         if ( is_network_admin() ) {
    357             $link = add_query_arg( [ 'page' => 'bp_groups_civicrm_sync_parent' ], network_admin_url( 'settings.php' ) );
    358         } else {
    359             $link = add_query_arg( [ 'page' => 'bp_groups_civicrm_sync_parent' ], admin_url( 'admin.php' ) );
    360         }
    361 
    362         // Add settings link.
    363         $links[] = '<a href="' . $link . '">' . esc_html__( 'Settings', 'bp-groups-civicrm-sync' ) . '</a>';
    364 
    365         // Add Paypal link.
    366         $paypal  = 'https://www.paypal.me/interactivist';
    367         $links[] = '<a href="' . $paypal . '" target="_blank">' . __( 'Donate!', 'bp-groups-civicrm-sync' ) . '</a>';
    368 
    369     }
    370 
    371     // --<
    372     return $links;
    373 
    374 }
    375 
    376 // Add filters for the above.
    377 add_filter( 'network_admin_plugin_action_links', 'bp_groups_civicrm_sync_plugin_action_links', 10, 2 );
    378 add_filter( 'plugin_action_links', 'bp_groups_civicrm_sync_plugin_action_links', 10, 2 );
  • bp-groups-civicrm-sync/trunk/includes/civicrm/class-civicrm-group-contact.php

    r3035828 r3147635  
    703703
    704704        // Return early if something went wrong.
    705         if ( ! empty( $result['error'] ) ) {
     705        if ( ! empty( $result['is_error'] ) && 1 === (int) $result['is_error'] ) {
    706706            $e     = new \Exception();
    707707            $trace = $e->getTraceAsString();
     
    754754
    755755        // Return early if something went wrong.
    756         if ( ! empty( $result['error'] ) ) {
     756        if ( ! empty( $result['is_error'] ) && 1 === (int) $result['is_error'] ) {
    757757            $e     = new \Exception();
    758758            $trace = $e->getTraceAsString();
  • bp-groups-civicrm-sync/trunk/languages/bp-groups-civicrm-sync.pot

    r3069044 r3147635  
    11# Copyright (C) 2024 Christian Wach
    2 # This file is distributed under the same license as the BP Groups CiviCRM Sync plugin.
     2# This file is distributed under the GPLv2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: BP Groups CiviCRM Sync 0.5.1a\n"
     5"Project-Id-Version: BP Groups CiviCRM Sync 0.5.2a\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bp-groups-civicrm-sync\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-04-11T13:53:16+00:00\n"
     12"POT-Creation-Date: 2024-09-06T15:08:45+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    120120msgstr ""
    121121
    122 #: assets/templates/wordpress/settings/metaboxes/metabox-settings-submit.php:41
     122#: assets/templates/wordpress/settings/metaboxes/metabox-settings-submit.php:46
    123123msgid "Update"
    124124msgstr ""
     
    128128msgstr ""
    129129
    130 #: bp-groups-civicrm-sync.php:363
     130#: bp-groups-civicrm-sync.php:362
    131131#: includes/admin/class-page-settings.php:127
    132132#: includes/admin/class-page-settings.php:130
     
    134134msgstr ""
    135135
    136 #: bp-groups-civicrm-sync.php:367
     136#: bp-groups-civicrm-sync.php:366
    137137msgid "Donate!"
    138138msgstr ""
  • bp-groups-civicrm-sync/trunk/readme.txt

    r3069044 r3147635  
    44Tags: civicrm, buddypress, user, groups, sync
    55Requires at least: 4.9
    6 Tested up to: 6.5
    7 Stable tag: 0.5.1
     6Tested up to: 6.6
     7Stable tag: 0.5.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    4444
    4545== Changelog ==
     46
     47= 0.5.2 =
     48
     49* Fixes CiviCRM API error check
    4650
    4751= 0.5.1 =
Note: See TracChangeset for help on using the changeset viewer.