Skip to content

Commit 9ff0863

Browse files
authored
Merge pull request #163 from gigya/develop
Version 6.1.0 – removing social features
2 parents 9899750 + 24ce015 commit 9ff0863

32 files changed

+65
-2148
lines changed

GigyaAction.php

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -78,42 +78,17 @@ public function __construct() {
7878
add_action( 'rest_api_init', array( $this, 'appendUserMetaToRestAPI' ) );
7979
add_action( 'gigya_offline_sync_cron', array( $this, 'executeOfflineSyncCron' ) );
8080
add_shortcode( 'gigya_user_info', array( $this, 'shortcodeUserInfo' ) );
81-
add_filter( 'the_content', array( $this, 'theContent' ) );
8281
add_filter( 'get_avatar', array( $this, 'getGigyaAvatar' ), 10, 5 );
8382
add_filter( 'login_message', 'raas_wp_login_custom_message' );
8483
add_filter( 'cron_schedules', array( $this, 'getOfflineSyncSchedules' ) );
8584

86-
if ( gigya_comments_on() ) {
87-
add_filter( 'comments_template', [ $this, 'commentsTemplate' ] );
88-
}
89-
9085
/* Plugins shortcode activation switches */
9186
require_once GIGYA__PLUGIN_DIR . 'features/gigyaPluginsShortcodes.php';
9287
$shortcodes_class = new gigyaPluginsShortcodes();
9388

9489
add_shortcode( 'gigya-raas-login', array( $shortcodes_class, 'gigyaRaas' ) );
9590
add_shortcode( 'gigya-raas-profile', array( $shortcodes_class, 'gigyaRaas' ) );
9691
add_shortcode( 'gigya-social-login', array( $shortcodes_class, 'gigyaSocialLoginScode' ) );
97-
98-
$comments_switch = get_option( GIGYA__SETTINGS_COMMENTS );
99-
if ( ! empty( $comments_switch ) and ( count( $comments_switch ) > 0 ) and ( $comments_switch['on'] == true or $comments_switch['on'] == '1' ) ) {
100-
add_shortcode( 'gigya-comments', array( $shortcodes_class, 'gigyaCommentsScode' ) );
101-
}
102-
$reaction_switch = get_option( GIGYA__SETTINGS_REACTIONS );
103-
if ( ! empty( $reaction_switch ) and ( count( $reaction_switch ) > 0 ) and ( $reaction_switch['on'] == true or $reaction_switch['on'] == '1' ) ) {
104-
add_shortcode( 'gigya-reactions', array( $shortcodes_class, 'gigyaReactionsScode' ) );
105-
}
106-
$share_switch = get_option( GIGYA__SETTINGS_SHARE );
107-
if ( ! empty( $share_switch ) and ( count( $share_switch ) > 0 ) and ( $share_switch['on'] == true or $share_switch['on'] == '1' ) ) {
108-
add_shortcode( 'gigya-share-bar', array( $shortcodes_class, 'gigyaShareBarScode' ) );
109-
}
110-
$gm_switch = get_option( GIGYA__SETTINGS_GM );
111-
if ( ! empty( $gm_switch ) and ( count( $gm_switch ) > 0 ) and ( $gm_switch['on'] == true or $gm_switch['on'] == '1' ) ) {
112-
add_shortcode( 'gigya-gm-achievements', array( $shortcodes_class, 'gigyaGmScode' ) );
113-
add_shortcode( 'gigya-gm-challenge-status', array( $shortcodes_class, 'gigyaGmScode' ) );
114-
add_shortcode( 'gigya-gm-leaderboard', array( $shortcodes_class, 'gigyaGmScode' ) );
115-
add_shortcode( 'gigya-gm-user-status', array( $shortcodes_class, 'gigyaGmScode' ) );
116-
}
11792
/* End plugins shortcodes activation switches */
11893
}
11994

@@ -641,91 +616,9 @@ public function widgetsInit() {
641616
register_widget( 'GigyaLogin_Widget' );
642617
}
643618

644-
/* Share Widget */
645-
$share_options = get_option( GIGYA__SETTINGS_SHARE );
646-
$share_on = _gigParamDefaultOn( $share_options, 'on' );
647-
if ( ! empty( $share_on ) ) {
648-
require_once GIGYA__PLUGIN_DIR . 'features/share/GigyaShareWidget.php';
649-
register_widget( 'GigyaShare_Widget' );
650-
}
651-
652-
/* Comment Widget */
653-
$comments_options = get_option( GIGYA__SETTINGS_COMMENTS );
654-
$comments_on = _gigParamDefaultOn( $comments_options, 'on' );
655-
if ( ! empty( $comments_on ) ) {
656-
require_once GIGYA__PLUGIN_DIR . 'features/comments/GigyaCommentsWidget.php';
657-
register_widget( 'GigyaComments_Widget' );
658-
}
659-
660-
/* Reactions Widget */
661-
$reactions_options = get_option( GIGYA__SETTINGS_REACTIONS );
662-
$reactions_on = _gigParamDefaultOn( $reactions_options, 'on' );
663-
if ( ! empty( $reactions_on ) ) {
664-
require_once GIGYA__PLUGIN_DIR . 'features/reactions/GigyaReactionsWidget.php';
665-
register_widget( 'GigyaReactions_Widget' );
666-
}
667-
668-
/* Gamification Widget */
669-
$gm_options = get_option( GIGYA__SETTINGS_GM );
670-
$gm_on = _gigParamDefaultOn( $gm_options, 'on' );
671-
if ( ! empty( $gm_on ) ) {
672-
require_once GIGYA__PLUGIN_DIR . 'features/gamification/GigyaGamificationWidget.php';
673-
register_widget( 'GigyaGamification_Widget' );
674-
}
675-
676619
return true;
677620
}
678621

679-
/**
680-
* Hook content alter.
681-
*
682-
* @param $content
683-
*
684-
* @return string $content
685-
*/
686-
public function theContent( $content ) {
687-
// Share plugin.
688-
$share_options = get_option( GIGYA__SETTINGS_SHARE );
689-
$share_on = _gigParamDefaultOn( $share_options, 'on' );
690-
if ( ! empty( $share_on ) ) {
691-
require_once GIGYA__PLUGIN_DIR . 'features/share/GigyaShareSet.php';
692-
$share = new GigyaShareSet();
693-
$content = $share->setDefaultPosition( $content );
694-
}
695-
696-
// Reactions plugin.
697-
$reactions_options = get_option( GIGYA__SETTINGS_REACTIONS );
698-
$reactions_on = _gigParamDefaultOn( $reactions_options, 'on' );
699-
if ( ! empty( $reactions_on ) ) {
700-
require_once GIGYA__PLUGIN_DIR . 'features/reactions/GigyaReactionsSet.php';
701-
$reactions = new GigyaReactionsSet();
702-
$content = $reactions->setDefaultPosition( $content );
703-
}
704-
705-
return $content;
706-
}
707-
708-
/**
709-
* Hook comments_template.
710-
*
711-
* @param $comment_template
712-
*
713-
* @return string
714-
*/
715-
public function commentsTemplate( $comment_template ) {
716-
/* Spider trap.
717-
* When a spider detect we render the comment in the HTML for SEO */
718-
$is_spider = gigyaCMS::isSpider();
719-
if ( ! empty( $is_spider ) ) {
720-
/* Override default WP comments template with comment spider */
721-
return GIGYA__PLUGIN_DIR . 'admin/tpl/comments-spider.tpl.php';
722-
}
723-
724-
/* Override default WP comments template */
725-
726-
return GIGYA__PLUGIN_DIR . 'admin/tpl/comments.tpl.php';
727-
}
728-
729622
/**
730623
* Hook AJAX Clean DB.
731624
*/

admin/admin.GigyaSettings.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,6 @@ public static function getSections() {
135135
'func' => 'sessionManagementForm',
136136
'slug' => 'gigya_session_management'
137137
),
138-
'gigya_share_settings' => array(
139-
'title' => 'Share Settings',
140-
'func' => 'shareSettingsForm',
141-
'slug' => 'gigya_share_settings'
142-
),
143-
'gigya_comments_settings' => array(
144-
'title' => 'Comments',
145-
'func' => 'commentsSettingsForm',
146-
'slug' => 'gigya_comments_settings'
147-
),
148-
'gigya_reactions_settings' => array(
149-
'title' => 'Reactions',
150-
'func' => 'reactionsSettingsForm',
151-
'slug' => 'gigya_reactions_settings'
152-
),
153-
'gigya_gm_settings' => array(
154-
'title' => 'Gamification',
155-
'func' => 'gmSettingsForm',
156-
'slug' => 'gigya_gm_settings'
157-
),
158138
);
159139
}
160140

@@ -377,4 +357,4 @@ public static function _getSiteOptions( $option = GIGYA__SETTINGS_GLOBAL ) {
377357
return $options;
378358
}
379359

380-
}
360+
}

admin/forms/commentsSettingsForm.php

Lines changed: 0 additions & 71 deletions
This file was deleted.

admin/forms/gmSettingsForm.php

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)