Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19 from SpotIM/develop
Browse files Browse the repository at this point in the history
Version Update 4.5.2
  • Loading branch information
dharmin authored Jul 25, 2019
2 parents 4ca5dd4 + a27eeab commit 76ce68f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 39 deletions.
5 changes: 4 additions & 1 deletion inc/class-spotim-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ protected function __construct() {
'embed_method' => 'content',
'rc_embed_method' => 'regular',
'display_rc_amp_ad_tag' => '0',
'enable_rating_reviews' => '0',
'display_priority' => 9999,
'enable_seo' => 'false',
'enable_og' => 'false',
Expand Down Expand Up @@ -179,7 +180,8 @@ private function get_meta_data() {
$data['display_page'] = sanitize_text_field( $data['display_page'] );
$data['display_attachment'] = sanitize_text_field( $data['display_attachment'] );
$data['display_newsfeed'] = sanitize_text_field( $data['display_newsfeed'] );
$data['display_rc_amp_ad_tag'] = sanitize_text_field( $data['display_rc_amp_ad_tag'] );
$data['display_rc_amp_ad_tag'] = isset( $data['display_rc_amp_ad_tag'] ) ? sanitize_text_field( $data['display_rc_amp_ad_tag'] ) : $this->default_options['display_rc_amp_ad_tag'];
$data['enable_rating_reviews'] = isset( $data['enable_rating_reviews'] ) ? sanitize_text_field( $data['enable_rating_reviews'] ) : $this->default_options['enable_rating_reviews'];

$data = array_merge( $this->default_options, $data );
}
Expand Down Expand Up @@ -284,6 +286,7 @@ public function validate( $input ) {
case 'display_attachment':
case 'display_newsfeed':
case 'display_rc_amp_ad_tag':
case 'enable_rating_reviews':
$options[ $key ] = sanitize_text_field( $value );
break;
case 'posts_per_request':
Expand Down
19 changes: 19 additions & 0 deletions inc/class-spotim-settings-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,25 @@ public function register_advanced_section() {
)
);

add_settings_field(
'enable_rating_reviews',
esc_html__( 'Star rating reviews in conversation', 'spotim-comments' ),
array( 'SpotIM_Form_Helper', 'radio_fields' ),
$this->options->slug,
'advanced_settings_section',
array(
'id' => 'enable_rating_reviews',
'page' => $this->options->slug,
'fields' => array(
'1' => esc_html__( 'Enable', 'spotim-comments' ),
'0' => esc_html__( 'Disable', 'spotim-comments' ),
),
'value' => $this->options->get( 'enable_rating_reviews' ),
)
);



add_settings_field(
'display_priority',
esc_html__( 'Display Priority', 'spotim-comments' ),
Expand Down
60 changes: 32 additions & 28 deletions language/spotim-comments.pot
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ msgstr ""
msgid "Spot.IM"
msgstr ""

#: inc/class-spotim-admin.php:427, inc/class-spotim-settings-fields.php:508
#: inc/class-spotim-admin.php:427, inc/class-spotim-settings-fields.php:527
msgid "Spot ID is missing."
msgstr ""

#: inc/class-spotim-admin.php:441, inc/class-spotim-settings-fields.php:509
#: inc/class-spotim-admin.php:441, inc/class-spotim-settings-fields.php:528
msgid "Import token is missing."
msgstr ""

Expand Down Expand Up @@ -76,11 +76,11 @@ msgstr ""
msgid "Comments"
msgstr ""

#: inc/class-spotim-metabox.php:291, inc/class-spotim-metabox.php:339, inc/class-spotim-settings-fields.php:195, inc/class-spotim-settings-fields.php:235, inc/class-spotim-settings-fields.php:325, inc/class-spotim-settings-fields.php:359, inc/class-spotim-settings-fields.php:376
#: inc/class-spotim-metabox.php:291, inc/class-spotim-metabox.php:339, inc/class-spotim-settings-fields.php:195, inc/class-spotim-settings-fields.php:235, inc/class-spotim-settings-fields.php:325, inc/class-spotim-settings-fields.php:343, inc/class-spotim-settings-fields.php:378, inc/class-spotim-settings-fields.php:395
msgid "Enable"
msgstr ""

#: inc/class-spotim-metabox.php:293, inc/class-spotim-metabox.php:341, inc/class-spotim-settings-fields.php:194, inc/class-spotim-settings-fields.php:217, inc/class-spotim-settings-fields.php:234, inc/class-spotim-settings-fields.php:326, inc/class-spotim-settings-fields.php:358, inc/class-spotim-settings-fields.php:375
#: inc/class-spotim-metabox.php:293, inc/class-spotim-metabox.php:341, inc/class-spotim-settings-fields.php:194, inc/class-spotim-settings-fields.php:217, inc/class-spotim-settings-fields.php:234, inc/class-spotim-settings-fields.php:326, inc/class-spotim-settings-fields.php:344, inc/class-spotim-settings-fields.php:377, inc/class-spotim-settings-fields.php:394
msgid "Disable"
msgstr ""

Expand All @@ -104,11 +104,11 @@ msgstr ""
msgid "Show Spot.IM recirculation."
msgstr ""

#: inc/class-spotim-options.php:437
#: inc/class-spotim-options.php:440
msgid "Next sync on next page refresh."
msgstr ""

#: inc/class-spotim-options.php:440
#: inc/class-spotim-options.php:443
msgid "Next sync in %s."
msgstr ""

Expand Down Expand Up @@ -233,94 +233,98 @@ msgid "Please contact your account manager to activate the Ad tag for AMP powere
msgstr ""

#: inc/class-spotim-settings-fields.php:335
msgid "Star rating reviews in conversation"
msgstr ""

#: inc/class-spotim-settings-fields.php:354
msgid "Display Priority"
msgstr ""

#: inc/class-spotim-settings-fields.php:350
#: inc/class-spotim-settings-fields.php:369
msgid "Enable SEO"
msgstr ""

#: inc/class-spotim-settings-fields.php:367
#: inc/class-spotim-settings-fields.php:386
msgid "OpenGraph Tags"
msgstr ""

#: inc/class-spotim-settings-fields.php:384
#: inc/class-spotim-settings-fields.php:403
msgid "Container Class"
msgstr ""

#: inc/class-spotim-settings-fields.php:397
#: inc/class-spotim-settings-fields.php:416
msgid "Disqus Shortname"
msgstr ""

#: inc/class-spotim-settings-fields.php:410
#: inc/class-spotim-settings-fields.php:429
msgid "Disqus Identifier Structure"
msgstr ""

#: inc/class-spotim-settings-fields.php:418
#: inc/class-spotim-settings-fields.php:437
msgid "ID"
msgstr ""

#: inc/class-spotim-settings-fields.php:419
#: inc/class-spotim-settings-fields.php:438
msgid "Short URL"
msgstr ""

#: inc/class-spotim-settings-fields.php:420
#: inc/class-spotim-settings-fields.php:439
msgid "ID + Short URL (Default)"
msgstr ""

#: inc/class-spotim-settings-fields.php:428
#: inc/class-spotim-settings-fields.php:447
msgid "Start Manual Sync"
msgstr ""

#: inc/class-spotim-settings-fields.php:435
#: inc/class-spotim-settings-fields.php:454
msgid "Sync Now"
msgstr ""

#: inc/class-spotim-settings-fields.php:439
#: inc/class-spotim-settings-fields.php:458
msgid "Reset + Sync Now"
msgstr ""

#: inc/class-spotim-settings-fields.php:440
#: inc/class-spotim-settings-fields.php:459
msgid "Use Sync Now to sync data starting from the last sync time."
msgstr ""

#: inc/class-spotim-settings-fields.php:440
#: inc/class-spotim-settings-fields.php:459
msgid "Use Reset + Sync Now to clear any old synced data and start a fresh sync."
msgstr ""

#: inc/class-spotim-settings-fields.php:444
#: inc/class-spotim-settings-fields.php:463
msgid "Cancel"
msgstr ""

#: inc/class-spotim-settings-fields.php:467
#: inc/class-spotim-settings-fields.php:486
msgid "Comments Sync Options"
msgstr ""

#: inc/class-spotim-settings-fields.php:474
#: inc/class-spotim-settings-fields.php:493
msgid "Sync Token"
msgstr ""

#: inc/class-spotim-settings-fields.php:481
#: inc/class-spotim-settings-fields.php:500
msgid "Contact your Spot.IM account manager to get your sync token."
msgstr ""

#: inc/class-spotim-settings-fields.php:488
#: inc/class-spotim-settings-fields.php:507
msgid "No"
msgstr ""

#: inc/class-spotim-settings-fields.php:498
#: inc/class-spotim-settings-fields.php:517
msgid "Enable Auto Sync"
msgstr ""

#: inc/class-spotim-settings-fields.php:505
#: inc/class-spotim-settings-fields.php:524
msgid "Enable auto-sync and set how often should it reoccur."
msgstr ""

#: inc/class-spotim-settings-fields.php:523
#: inc/class-spotim-settings-fields.php:542
msgid "Posts Per Request"
msgstr ""

#: inc/class-spotim-settings-fields.php:530
#: inc/class-spotim-settings-fields.php:549
msgid "On every sync, several requests will be made to your server. This is the amount of posts that will be retrieved in each request. Default: 10."
msgstr ""

Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: Comment, comment form, commenting, comments, comment author, comment form,
Requires at least: 4.0
Tested up to: 5.2.2
Requires PHP: 5.4
Stable tag: 4.5.1
Stable tag: 4.5.2
License: GPLv2 or later
License URI: license.txt

Expand Down Expand Up @@ -203,6 +203,9 @@ You are also always more than welcome to contact our team at [email protected]. We

== Changelog ==

= 4.5.2 =
* Add support for Star Rating Reviews.

= 4.5.1 =
* Update AMP templates to comply with WordPress VIP standard.

Expand Down Expand Up @@ -396,5 +399,5 @@ You are also always more than welcome to contact our team at [email protected]. We

== Upgrade notice ==

= 4.5.1 =
* Update AMP templates to comply with WordPress VIP standard.
= 4.5.2 =
* Add support for Star Rating Reviews.
6 changes: 3 additions & 3 deletions spotim-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Spot.IM Comments
* Plugin URI: https://wordpress.org/plugins/spotim-comments/
* Description: Real-time comments widget turns your site into its own content-circulating ecosystem.
* Version: 4.5.1
* Version: 4.5.2
* Author: Spot.IM
* Author URI: https://github.com/SpotIM
* License: GPLv2
Expand All @@ -22,9 +22,9 @@
/**
* The version of the plugin
*
* @since 4.5.1
* @since 4.5.2
*/
define( 'SPOTIM_VERSION', '4.5.1' );
define( 'SPOTIM_VERSION', '4.5.2' );
}

/**
Expand Down
10 changes: 6 additions & 4 deletions templates/comments-template.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
$options = SpotIM_Options::get_instance();
$front = new SpotIM_Frontend( $options );
$spot_id = $options->get( 'spot_id' );
$recirculation_method = $options->get( 'rc_embed_method' );
$options = SpotIM_Options::get_instance();
$front = new SpotIM_Frontend( $options );
$spot_id = $options->get( 'spot_id' );
$recirculation_method = $options->get( 'rc_embed_method' );
$enable_rating_reviews = 0 === absint( $options->get( 'enable_rating_reviews' ) ) ? 'false' : 'true';

switch ( $options->get( 'disqus_identifier' ) ) {
case 'id':
Expand Down Expand Up @@ -33,6 +34,7 @@
data-spotim-module="spotim-launcher"
data-article-tags="<?php echo esc_attr( implode( ', ', wp_get_post_tags( get_the_ID(), array( 'fields' => 'names' ) ) ) ); ?>"
src="<?php echo esc_url( 'https://launcher.spot.im/spot/' . $spot_id ); ?>"
data-social-reviews="<?php echo esc_attr( $enable_rating_reviews ); ?>"
data-post-id="<?php echo esc_attr( apply_filters( 'spotim_comments_post_id', get_the_ID() ) ); ?>"
data-post-url="<?php echo esc_url( apply_filters( 'spotim_comments_post_url', get_permalink() ) ); ?>"
data-short-url="<?php echo esc_url( apply_filters( 'spotim_comments_disqus_short_url', site_url( '/?p=' . get_the_id() ) ) ); ?>"
Expand Down

0 comments on commit 76ce68f

Please sign in to comment.