WordPress.org

Plugin Directory

Changeset 1697603


Ignore:
Timestamp:
07/17/17 16:19:18 (2 months ago)
Author:
ramiy
Message:

version 4.1.0

Location:
spotim-comments/trunk
Files:
3 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • spotim-comments/trunk/assets/stylesheets/admin.css

    r1590745 r1697603  
     1.spotim-page-wrap .nav-tab-wrapper { 
     2    border-bottom: 0; 
     3} 
     4.spotim-page-wrap .nav-tab-wrapper a { 
     5    border-bottom: 1px solid #ccc; 
     6    margin: 0 10px 0 0; 
     7} 
    18.spotim-page-wrap .nav-tab-active { 
    29    background-color: #fff; 
    310    border-bottom-color: #fff; 
    411} 
     12.spotim-page-wrap .nav-tab-wrapper .pull-to-end { 
     13    float: right; 
     14    margin-right: 0; 
     15} 
     16.spotim-page-wrap .nav-tab-wrapper .pull-to-end:hover, 
     17.spotim-page-wrap .nav-tab-wrapper .pull-to-end:focus { 
     18    color: #0073aa; 
     19} 
    520.spotim-page-wrap form { 
    621    background-color: #fff; 
    722    border: 1px solid #ccc; 
    8     border-top: 0; 
     23    margin-top: 10px; 
    924    padding: 5px 15px; 
    1025} 
     
    3550    display: none; 
    3651    font-size: 13px; 
    37     margin-left: 40px; 
     52    margin: 0 40px; 
    3853} 
    3954.spotim-page-wrap .in-progress #cancel_import_link { 
    4055    display: inline-block; 
    4156} 
     57 
     58/* RTL */ 
     59 
     60.rtl .spotim-page-wrap .nav-tab-wrapper a { 
     61    margin: 0 0 0 10px; 
     62} 
     63.rtl .spotim-page-wrap .nav-tab-wrapper .pull-to-end { 
     64    float: left; 
     65    margin-left: 0; 
     66} 
     67.rtl .spotim-page-wrap #import_button[disabled]:after { 
     68    right: initial; 
     69    left: -30px; 
     70} 
  • spotim-comments/trunk/inc/class-spotim-admin.php

    r1640492 r1697603  
    3232     * 
    3333     * @access public 
    34      * @static 
    3534     * 
    3635     * @param SpotIM_Options $options Plugin options. 
     
    3837     * @return void 
    3938     */ 
    40     public static function launch( $options ) { 
     39    public function __construct( $options ) { 
    4140        self::$options = $options; 
    4241        new SpotIM_Meta_Box( $options ); 
     
    127126        // Register settings fields only for the active tab 
    128127        switch ( self::$options->active_tab ) { 
    129             case 'export': 
    130                 $settings_fields->register_export_section(); 
    131                 break; 
    132128            case 'import': 
    133129                $settings_fields->register_import_section(); 
     130                break; 
     131            case 'advanced': 
     132                $settings_fields->register_advanced_section(); 
    134133                break; 
    135134            case 'display': 
  • spotim-comments/trunk/inc/class-spotim-cron.php

    r1640492 r1697603  
    8383        $spot_id           = sanitize_text_field( self::$options->get( 'spotim_spot_id' ) ); 
    8484        $import_token      = sanitize_text_field( self::$options->get( 'spotim_import_token' ) ); 
    85         $page_number       = empty( self::$options->get( 'spotim_page_number' ) ) ? absint( self::$options->get( 'spotim_page_number' ) ) : 0; 
    86         $posts_per_request = empty( self::$options->get( 'spotim_posts_per_request' ) ) ? absint( self::$options->get( 'spotim_posts_per_request' ) ) : 0; 
     85        $page_number       = self::$options->get( 'spotim_page_number' ); 
     86        $page_number       = empty( $page_number ) ? absint( $page_number ) : 0; 
     87        $posts_per_request = self::$options->get( 'spotim_posts_per_request' ); 
     88        $posts_per_request = empty( $posts_per_request ) ? absint( $posts_per_request ) : 0; 
    8789 
    8890        if ( empty( $spot_id ) ) 
  • spotim-comments/trunk/inc/class-spotim-frontend.php

    r1640492 r1697603  
    3232     * 
    3333     * @access public 
    34      * @static 
    3534     * 
    3635     * @param SpotIM_Options $options Plugin options. 
     
    3837     * @return void 
    3938     */ 
    40     public static function launch( $options ) { 
     39    public function __construct( $options ) { 
     40 
    4141        // Set options 
    4242        self::$options = $options; 
    4343 
     44        // Make sure Spot ID is not empty. 
     45        $spot_id = self::$options->get( 'spot_id' ); 
     46        if ( empty( $spot_id ) ) 
     47            return; 
     48 
     49        $embed_method = self::$options->get( 'embed_method' ); 
     50        $display_priority = self::$options->get( 'display_priority' ); 
     51 
     52        // SpotIM Recirculation 
     53        add_action( 'the_content', array( __CLASS__, 'add_spotim_recirculation' ), $display_priority ); 
     54 
    4455        // SpotIM Comments 
    45         add_filter( 'comments_template', array( __CLASS__, 'filter_comments_template' ), 20 ); 
    46         add_filter( 'comments_number', array( __CLASS__, 'filter_comments_number' ), 20 ); 
    4756        add_action( 'wp_footer', array( __CLASS__, 'comments_footer_scripts' ) ); 
    48  
    49         // SpotIM Recirculation 
    50         add_action( 'the_content', array( __CLASS__, 'add_spotim_recirculation' ), 100 ); 
     57        if ( $embed_method == 'content' ) { 
     58 
     59            // Add after the content 
     60            add_action( 'the_content', array( __CLASS__, 'the_content_comments_template' ), $display_priority ); 
     61            add_filter( 'comments_template', array( __CLASS__, 'empty_comments_template' ), 20 ); 
     62 
     63        } else { 
     64 
     65            // Replace the WordPress comments 
     66            add_filter( 'comments_template', array( __CLASS__, 'filter_comments_template' ), 20 ); 
     67            add_filter( 'comments_number', array( __CLASS__, 'filter_comments_number' ), 20 ); 
     68 
     69        } 
     70 
    5171    } 
    5272 
     
    7393 
    7494        // Bail if Spot.IM is disabled for this post type 
    75         if ( ! in_array( self::$options->get( "display_{$post->post_type}" ), array( 'comments', 'comments_recirculation' ), true ) ) 
     95        if ( '0' === self::$options->get( "display_{$post->post_type}" ) ) 
    7696            return false; 
    7797 
     
    84104        // Return true if all tests passed 
    85105        return true; 
     106    } 
     107 
     108    /** 
     109     * Empty comments template 
     110     * 
     111     * @since 4.1.0 
     112     * 
     113     * @access public 
     114     * @static 
     115     * 
     116     * @param string $template Comments template to load. 
     117     * 
     118     * @return string 
     119     */ 
     120    public static function empty_comments_template( $template ) { 
     121 
     122        if ( self::has_spotim_comments() ) { 
     123 
     124            // Load empty comments template 
     125            $require_template_path = self::$options->require_template( 'comments-template-empty.php', true ); 
     126            if ( ! empty( $require_template_path ) ) { 
     127                $template = $require_template_path; 
     128            } 
     129 
     130        } 
     131 
     132        return $template; 
     133    } 
     134 
     135    /** 
     136     * Filter comments template 
     137     * 
     138     * @since 4.1.0 
     139     * 
     140     * @access public 
     141     * @static 
     142     * 
     143     * @param string $template Comments template to load. 
     144     * 
     145     * @return string 
     146     */ 
     147    public static function the_content_comments_template( $content ) { 
     148 
     149        if ( self::has_spotim_comments() ) { 
     150 
     151            // Load SpotIM comments template 
     152            ob_start(); 
     153            include( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/comments-template.php' ); 
     154            $content .= ob_get_contents(); 
     155            ob_end_clean(); 
     156 
     157        } 
     158 
     159        return $content; 
     160 
    86161    } 
    87162 
     
    191266 
    192267        // Bail if Spot.IM is disabled for this post type 
    193         if ( ! in_array( self::$options->get( "display_{$post->post_type}" ), array( 'comments', 'comments_recirculation' ), true ) ) 
     268        if ( '0' === self::$options->get( "display_{$post->post_type}" ) ) 
    194269            return false; 
    195270 
     
    225300 
    226301        // Bail if Spot.IM is disabled for this post type 
    227         if ( 'comments_recirculation' !== self::$options->get( "display_{$post->post_type}" ) ) 
     302        if ( '0' === self::$options->get( "display_{$post->post_type}" ) ) 
    228303            return false; 
    229304 
  • spotim-comments/trunk/inc/class-spotim-metabox.php

    r1640492 r1697603  
    8383        foreach ( $post_types as $post_type ) { 
    8484 
    85             // only for post types where comments or recirculation are enabled 
    86             if ( in_array( self::$options->get( "display_{$post_type}" ), array( 'comments', 'comments_recirculation' ), true ) ) { 
     85            // only for post types where Spot.IM is enabled 
     86            if ( '0' !== self::$options->get( "display_{$post_type}" ) ) { 
    8787                $screen[] = $post_type; 
    8888            } 
     
    152152        echo '  </tr>'; 
    153153 
    154         if ( 'comments_recirculation' === self::$options->get( "display_{$post->post_type}" ) ) { 
    155             echo '  <tr>'; 
    156             echo '      <th><label for="spotim_display_recirculation" class="spotim_display_recirculation_label">' . esc_html__( 'Recirculation', 'spotim-comments' ) . '</label></th>'; 
    157             echo '      <td>'; 
    158             echo '          <select id="spotim_display_recirculation" name="spotim_display_recirculation" class="spotim_display_recirculation_field">'; 
    159             echo '          <option value="enable" '  . selected( $spotim_display_recirculation, 'enable',  false ) . '> ' . esc_html__( 'Enable', 'spotim-comments' ) . '</option>'; 
    160             echo '          <option value="disable" ' . selected( $spotim_display_recirculation, 'disable', false ) . '> ' . esc_html__( 'Disable', 'spotim-comments' ) . '</option>'; 
    161             echo '          </select>'; 
    162             echo '          <p class="description">' . esc_html__( 'Show Spot.IM recirculation.', 'spotim-comments' ) . '</p>'; 
    163             echo '      </td>'; 
    164             echo '  </tr>'; 
    165         } 
     154        echo '  <tr>'; 
     155        echo '      <th><label for="spotim_display_recirculation" class="spotim_display_recirculation_label">' . esc_html__( 'Recirculation', 'spotim-comments' ) . '</label></th>'; 
     156        echo '      <td>'; 
     157        echo '          <select id="spotim_display_recirculation" name="spotim_display_recirculation" class="spotim_display_recirculation_field">'; 
     158        echo '          <option value="enable" '  . selected( $spotim_display_recirculation, 'enable',  false ) . '> ' . esc_html__( 'Enable', 'spotim-comments' ) . '</option>'; 
     159        echo '          <option value="disable" ' . selected( $spotim_display_recirculation, 'disable', false ) . '> ' . esc_html__( 'Disable', 'spotim-comments' ) . '</option>'; 
     160        echo '          </select>'; 
     161        echo '          <p class="description">' . esc_html__( 'Show Spot.IM recirculation.', 'spotim-comments' ) . '</p>'; 
     162        echo '      </td>'; 
     163        echo '  </tr>'; 
    166164 
    167165        echo '</table>'; 
     
    199197        $new_spotim_display_comments = isset( $_POST['spotim_display_comments'] ) ? sanitize_text_field( $_POST['spotim_display_comments'] ) : ''; 
    200198        $new_spotim_display_question = isset( $_POST['spotim_display_question'] ) ? sanitize_text_field( $_POST['spotim_display_question'] ) : ''; 
    201         if ( 'comments_recirculation' === self::$options->get( "display_{$post->post_type}" ) ) { 
    202             $new_spotim_display_recirculation = isset( $_POST['spotim_display_recirculation'] ) ? sanitize_text_field( $_POST['spotim_display_recirculation'] ) : ''; 
    203         } 
     199        $new_spotim_display_recirculation = isset( $_POST['spotim_display_recirculation'] ) ? sanitize_text_field( $_POST['spotim_display_recirculation'] ) : ''; 
    204200 
    205201        // Update the meta field in the database. 
    206202        update_post_meta( $post_id, 'spotim_display_comments', $new_spotim_display_comments ); 
    207203        update_post_meta( $post_id, 'spotim_display_question', $new_spotim_display_question ); 
    208         if ( 'comments_recirculation' === self::$options->get( "display_{$post->post_type}" ) ) { 
    209             update_post_meta( $post_id, 'spotim_display_recirculation', $new_spotim_display_recirculation ); 
    210         } 
     204        update_post_meta( $post_id, 'spotim_display_recirculation', $new_spotim_display_recirculation ); 
    211205 
    212206    } 
  • spotim-comments/trunk/inc/class-spotim-options.php

    r1640492 r1697603  
    9797            'spot_id' => '', 
    9898            // Display 
    99             'display_post' => 'comments_recirculation', 
    100             'display_page' => 'comments_recirculation', 
    101             'display_attachment' => 'none', 
     99            'display_post' => '1', 
     100            'display_page' => '1', 
     101            'display_attachment' => '0', 
     102            'comments_per_page' => 10, 
     103            // Advanced 
     104            'plugin_secret' => '', 
     105            'embed_method' => 'comments', 
     106            'display_priority' => 9999, 
     107            'class' => 'comments-area', 
     108            'external_import' => '', 
     109            'disqus_identifier' => 'id_short_url', 
    102110            // Import 
    103111            'import_token' => '', 
     
    121129     */ 
    122130    public static function get_instance() { 
    123         if ( is_null( static::$instance ) ) { 
    124             static::$instance = new static(); 
    125         } 
    126  
    127         return static::$instance; 
     131        if ( is_null( self::$instance ) ) { 
     132            self::$instance = new self; 
     133        } 
     134 
     135        return self::$instance; 
    128136    } 
    129137 
     
    197205     */ 
    198206    public function update( $name, $value ) { 
     207 
     208        // Recreate rewrite rules 
     209        flush_rewrite_rules(); 
     210 
    199211        $new_option = array(); 
    200212        $new_option[ $name ] = $value; 
     
    204216 
    205217        $options_updated = update_option( $this->slug, $options ); 
    206  
    207218 
    208219        if ( $options_updated ) { 
  • spotim-comments/trunk/inc/class-spotim-settings-fields.php

    r1640492 r1697603  
    7575 
    7676    /** 
     77     * Advanced Settings Section Header 
     78     * 
     79     * @since 4.1.0 
     80     * 
     81     * @access public 
     82     * 
     83     * @return void 
     84     */ 
     85    public function advanced_settings_section_header() { 
     86        echo '<p>' . esc_html__( 'Set advanced Spot.IM settings.', 'spotim-comments' ) . '</p>'; 
     87    } 
     88 
     89    /** 
    7790     * Import Settings Section Header 
    7891     * 
     
    88101 
    89102    /** 
    90      * Export Settings Section Header 
    91      * 
    92      * @since 4.0.0 
    93      * 
    94      * @access public 
    95      * 
    96      * @return void 
    97      */ 
    98     public function export_settings_section_header() { 
    99         echo '<p>' . esc_html__( 'Export your comments from WordPress to Spot.IM.', 'spotim-comments' ) . '</p>'; 
    100     } 
    101  
    102     /** 
    103103     * Register General Section 
    104104     * 
     
    110110     */ 
    111111    public function register_general_section() { 
     112        $spot_id = $this->options->get( 'spot_id' ); 
     113 
    112114        add_settings_section( 
    113115            'general_settings_section', 
     
    117119        ); 
    118120 
    119         $translated_spot_id_description = sprintf( 
    120             __( 'Find your Spot ID at the <a href="%s" target="_blank">Spot.IM\'s Admin Dashboard</a> under "Features" section.' , 'spotim-comments' ), 
    121             'https://admin.spot.im/login' 
    122         ); 
    123  
    124121        add_settings_field( 
    125122            'spot_id', 
     
    131128                'id' => 'spot_id', 
    132129                'page' => $this->options->slug, 
    133                 'description' => $translated_spot_id_description, 
    134                 'value' => $this->options->get( 'spot_id' ) 
     130                'description' => sprintf( 
     131                    __( 'Find your Spot ID at the <a href="%s" target="_blank">Spot.IM\'s Admin Dashboard</a> under "Features" section.' , 'spotim-comments' ), 
     132                    'https://admin.spot.im/login' 
     133                ), 
     134                'value' => $spot_id 
    135135            ) 
    136136        ); 
     
    163163                // Check if post type support comments 
    164164                if ( post_type_supports( $value->name, 'comments' ) ) { 
     165 
     166                    $display_value = $this->options->get( "display_{$value->name}" ); 
     167 
     168                    // Backwards compitability check - rewrite old structure 
     169                    if ( ( 'comments' === $display_value ) || ( 'comments_recirculation' === $display_value ) ) { $display_value = 1; } 
    165170 
    166171                    add_settings_field( 
     
    175180                            'fields' => array( 
    176181                                '0' => esc_html__( 'Disable', 'spotim-comments' ), 
    177                                 'comments' => esc_html__( 'Enable Comments', 'spotim-comments' ), 
    178                                 'comments_recirculation' => esc_html__( 'Enable Comments & Recirculation', 'spotim-comments' ), 
     182                                '1' => esc_html__( 'Enable', 'spotim-comments' ), 
    179183                            ), 
    180                             'value' => $this->options->get( "display_{$value->name}" ) 
     184                            'value' => $display_value 
    181185                        ) 
    182186                    ); 
     
    188192        } 
    189193 
     194        add_settings_field( 
     195            'comments_per_page', 
     196            esc_html__( 'Comments Per Page', 'spotim-comments' ), 
     197            array( 'SpotIM_Form_Helper', 'number_field' ), 
     198            $this->options->slug, 
     199            'display_settings_section', 
     200            array( 
     201                'id' => 'comments_per_page', 
     202                'page' => $this->options->slug, 
     203                'value' => $this->options->get( 'comments_per_page' ), 
     204                'min' => 1, 
     205                'max' => '999' 
     206            ) 
     207        ); 
     208 
     209    } 
     210 
     211    /** 
     212     * Register Advanced Section 
     213     * 
     214     * @since 4.1.0 
     215     * 
     216     * @access public 
     217     * 
     218     * @return void 
     219     */ 
     220    public function register_advanced_section() { 
     221 
     222        add_settings_section( 
     223            'advanced_settings_section', 
     224            esc_html__( 'Advanced Options', 'spotim-comments' ), 
     225            array( $this, 'advanced_settings_section_header' ), 
     226            $this->options->slug 
     227        ); 
     228 
     229        add_settings_field( 
     230            'plugin_secret', 
     231            esc_html__( 'Plugin Secret Token', 'spotim-comments' ), 
     232            array( 'SpotIM_Form_Helper', 'text_field' ), 
     233            $this->options->slug, 
     234            'advanced_settings_section', 
     235            array( 
     236                'id' => 'plugin_secret', 
     237                'page' => $this->options->slug, 
     238                'description' => sprintf ( esc_html__( 'Don\'t have a token? please send us an email to %s and get one.', 'spotim-comments' ), '<a href="mailto:support@spot.im">support@spot.im</a>' ), 
     239                'value' => $this->options->get( 'plugin_secret' ) 
     240            ) 
     241        ); 
     242 
     243        add_settings_field( 
     244            'embed_method', 
     245            esc_html__( 'Embed Method', 'spotim-comments' ), 
     246            array( 'SpotIM_Form_Helper', 'radio_fields' ), 
     247            $this->options->slug, 
     248            'advanced_settings_section', 
     249            array( 
     250                'id' => 'embed_method', 
     251                'page' => $this->options->slug, 
     252                'fields' => array( 
     253                    'comments' => esc_html__( 'Replace WordPress Comments', 'spotim-comments' ), 
     254                    'content' => esc_html__( 'Insert After the Content', 'spotim-comments' ), 
     255                ), 
     256                'description' => esc_html__( 'Dafault method should be replacing WordPress Comments. If it\'s not working, insert Spot.IM after the comments.', 'spotim-comments' ), 
     257                'value' => $this->options->get( 'embed_method' ) 
     258            ) 
     259        ); 
     260 
     261        add_settings_field( 
     262            'display_priority', 
     263            esc_html__( 'Display Priority', 'spotim-comments' ), 
     264            array( 'SpotIM_Form_Helper', 'number_field' ), 
     265            $this->options->slug, 
     266            'advanced_settings_section', 
     267            array( 
     268                'id' => 'display_priority', 
     269                'page' => $this->options->slug, 
     270                'description' => esc_html__( 'Set display priority among the items added by other plugin that use "the_content" filter.', 'spotim-comments' ), 
     271                'value' => $this->options->get( 'display_priority' ), 
     272                'min' => '0', 
     273                'max' => '10000' 
     274            ) 
     275        ); 
     276 
     277        add_settings_field( 
     278            'class', 
     279            esc_html__( 'Container Class', 'spotim-comments' ), 
     280            array( 'SpotIM_Form_Helper', 'text_field' ), 
     281            $this->options->slug, 
     282            'advanced_settings_section', 
     283            array( 
     284                'id' => 'class', 
     285                'page' => $this->options->slug, 
     286                'description' => esc_html__( 'Comments template container class. WordPress default class is "comments-area".', 'spotim-comments' ), 
     287                'value' => $this->options->get( 'class' ), 
     288            ) 
     289        ); 
     290 
     291        add_settings_field( 
     292            'external_import', 
     293            esc_html__( 'External Import', 'spotim-comments' ), 
     294            array( 'SpotIM_Form_Helper', 'radio_fields' ), 
     295            $this->options->slug, 
     296            'advanced_settings_section', 
     297            array( 
     298                'id' => 'external_import', 
     299                'page' => $this->options->slug, 
     300                'fields' => array( 
     301                    'facebook' => esc_html__( 'Facebook Comments', 'spotim-comments' ), 
     302                    'disqus' => esc_html__( 'Disqus Comments', 'spotim-comments' ), 
     303                    'wordpress' => esc_html__( 'WordPress Comments', 'spotim-comments' ), 
     304                ), 
     305                'description' => esc_html__( 'Import comments from external services.', 'spotim-comments' ), 
     306                'value' => $this->options->get( 'external_import' ) 
     307            ) 
     308        ); 
     309 
     310        add_settings_field( 
     311            'disqus_identifier', 
     312            esc_html__( 'Disqus Identifier Structure', 'spotim-comments' ), 
     313            array( 'SpotIM_Form_Helper', 'radio_fields' ), 
     314            $this->options->slug, 
     315            'advanced_settings_section', 
     316            array( 
     317                'id' => 'disqus_identifier', 
     318                'page' => $this->options->slug, 
     319                'fields' => array( 
     320                    'id' => esc_html__( 'ID', 'spotim-comments' ), 
     321                    'short_url' => esc_html__( 'Short URL', 'spotim-comments' ), 
     322                    'id_short_url' => esc_html__( 'ID + Short URL (Default)', 'spotim-comments' ), 
     323                ), 
     324                'description' => esc_html__( 'The structure of your Disqus identifier.', 'spotim-comments' ), 
     325                'value' => $this->options->get( 'disqus_identifier' ) 
     326            ) 
     327        ); 
     328 
    190329    } 
    191330 
     
    203342        add_settings_section( 
    204343            'import_settings_section', 
    205             esc_html__( 'Import Options', 'spotim-comments' ), 
     344            esc_html__( 'WP Sync Options', 'spotim-comments' ), 
    206345            array( $this, 'import_settings_section_header' ), 
    207346            $this->options->slug 
     
    233372                'description' => esc_html__( 'Amount of posts to retrieve in each request, depending on your server\'s strength.', 'spotim-comments' ), 
    234373                'value' => $this->options->get( 'posts_per_request' ), 
    235                 'min' => '0', 
    236                 'max' => '100' 
    237             ) 
    238         ); 
    239  
     374                'min' => '0', 
     375                'max' => '100' 
     376            ) 
     377        ); 
     378 
     379        $spot_id = $this->options->get( 'spot_id' ); 
     380        $import_token = $this->options->get( 'import_token' ); 
    240381        $schedule_fields['0'] = esc_html__( 'No', 'spotim-comments' ); 
    241382        $registered_schedules = wp_get_schedules(); 
     
    258399                    . '<br>' 
    259400                    . $this->options->get_next_cron_execution( wp_next_scheduled( 'spotim_scheduled_import' ) ) 
    260                     . ( ( empty( $this->options->get( 'spot_id' ) ) ) ? ' ' . esc_html__( 'Spot ID is missing.', 'spotim-comments' ) : '' ) 
    261                     . ( ( empty( $this->options->get( 'import_token' ) ) ) ? ' ' . esc_html__( 'Import token is missing.', 'spotim-comments' ) : '' ), 
     401                    . ( empty( $spot_id ) ? ' ' . esc_html__( 'Spot ID is missing.', 'spotim-comments' ) : '' ) 
     402                    . ( empty( $import_token ) ? ' ' . esc_html__( 'Import token is missing.', 'spotim-comments' ) : '' ), 
    262403                'fields' => $schedule_fields, 
    263404                'value' => $this->options->get( 'auto_import' ) 
     
    293434                'id' => 'spot_id', 
    294435                'page' => $this->options->slug, 
    295                 'value' => $this->options->get( 'spot_id' ) 
    296             ) 
    297         ); 
    298  
    299     } 
    300  
    301     /** 
    302      * Register Export Section 
    303      * 
    304      * @since 4.0.0 
    305      * 
    306      * @access public 
    307      * 
    308      * @return void 
    309      */ 
    310     public function register_export_section() { 
    311         add_settings_section( 
    312             'export_settings_section', 
    313             esc_html__( 'Export Options', 'spotim-comments' ), 
    314             array( $this, 'export_settings_section_header' ), 
    315             $this->options->slug 
    316         ); 
    317  
    318         add_settings_field( 
    319             'plugin_secret', 
    320             esc_html__( 'Export Token', 'spotim-comments' ), 
    321             array( 'SpotIM_Form_Helper', 'text_field' ), 
    322             $this->options->slug, 
    323             'export_settings_section', 
    324             array( 
    325                 'id' => 'plugin_secret', 
    326                 'page' => $this->options->slug, 
    327                 'description' => sprintf ( esc_html__( 'Don\'t have a token? please send us an email to %s and get one.', 'spotim-comments' ), '<a href="mailto:support@spot.im">support@spot.im</a>' ), 
    328                 'value' => $this->options->get( 'plugin_secret' ) 
    329             ) 
    330         ); 
    331  
    332     } 
     436                'value' => $spot_id 
     437            ) 
     438        ); 
     439 
     440    } 
     441 
    333442} 
  • spotim-comments/trunk/language/spotim-comments.pot

    r1640492 r1697603  
    1616"X-Poedit-SearchPathExcluded-0: *.js\n" 
    1717"Plural-Forms: nplurals=2; plural=(n != 1);\n" 
     18 
     19#: inc/class-spotim-admin.php:145 
     20msgid "Oops something got wrong. Please lower your amount of Posts Per Request and try again or send us an email to support@spot.im." 
     21msgstr "" 
     22 
    1823#: inc/class-spotim-admin.php:147 
    19 msgid "Oops something got wrong. Please lower your amount of Posts Per Request and try again or send us an email to support@spot.im." 
    20 msgstr "" 
    21  
    22 #: inc/class-spotim-admin.php:149 
    2324msgid "Cancel importing..." 
    2425msgstr "" 
    2526 
    26 #: inc/class-spotim-admin.php:205 
     27#: inc/class-spotim-admin.php:203 
    2728msgid "Spot.IM Settings" 
    2829msgstr "" 
    2930 
    30 #: inc/class-spotim-admin.php:207, inc/class-spotim-metabox.php:197 
     31#: inc/class-spotim-admin.php:205, inc/class-spotim-metabox.php:197 
    3132msgid "Spot.IM" 
    3233msgstr "" 
    3334 
    34 #: inc/class-spotim-admin.php:351, inc/class-spotim-settings-fields.php:515 
     35#: inc/class-spotim-admin.php:349, inc/class-spotim-settings-fields.php:801 
    3536msgid "Spot ID is missing." 
    3637msgstr "" 
    3738 
    38 #: inc/class-spotim-admin.php:365, inc/class-spotim-settings-fields.php:517 
     39#: inc/class-spotim-admin.php:363, inc/class-spotim-settings-fields.php:803 
    3940msgid "Import token is missing." 
    40 msgstr "" 
    41  
    42 #: inc/class-spotim-export.php:393 
    43 msgid "Unknown" 
    4441msgstr "" 
    4542 
     
    6057msgstr "" 
    6158 
    62 #: inc/class-spotim-import.php:679 
     59#: inc/class-spotim-import.php:705 
    6360msgid "Retriving data failed from this url: %s" 
    6461msgstr "" 
     
    6865msgstr "" 
    6966 
    70 #: inc/class-spotim-metabox.php:277, inc/class-spotim-metabox.php:317 
     67#: inc/class-spotim-metabox.php:277, inc/class-spotim-metabox.php:315, inc/class-spotim-settings-fields.php:363 
    7168msgid "Enable" 
    7269msgstr "" 
    7370 
    74 #: inc/class-spotim-metabox.php:279, inc/class-spotim-metabox.php:319, inc/class-spotim-settings-fields.php:351 
     71#: inc/class-spotim-metabox.php:279, inc/class-spotim-metabox.php:317, inc/class-spotim-settings-fields.php:361 
    7572msgid "Disable" 
    7673msgstr "" 
     
    8885msgstr "" 
    8986 
    90 #: inc/class-spotim-metabox.php:311 
     87#: inc/class-spotim-metabox.php:309 
    9188msgid "Recirculation" 
    9289msgstr "" 
    9390 
    94 #: inc/class-spotim-metabox.php:323 
     91#: inc/class-spotim-metabox.php:321 
    9592msgid "Show Spot.IM recirculation." 
    9693msgstr "" 
    9794 
    98 #: inc/class-spotim-options.php:823 
     95#: inc/class-spotim-options.php:845 
    9996msgid "Next import on next page refresh." 
    10097msgstr "" 
    10198 
    102 #: inc/class-spotim-options.php:829 
     99#: inc/class-spotim-options.php:851 
    103100msgid "Next import in %s." 
    104101msgstr "" 
     
    113110 
    114111#: inc/class-spotim-settings-fields.php:171 
     112msgid "Set advanced Spot.IM settings." 
     113msgstr "" 
     114 
     115#: inc/class-spotim-settings-fields.php:197 
    115116msgid "Import your comments from Spot.IM to WordPress." 
    116117msgstr "" 
    117118 
    118 #: inc/class-spotim-settings-fields.php:197 
    119 msgid "Export your comments from WordPress to Spot.IM." 
    120 msgstr "" 
    121  
    122 #: inc/class-spotim-settings-fields.php:227 
     119#: inc/class-spotim-settings-fields.php:231 
    123120msgid "General Options" 
    124121msgstr "" 
    125122 
    126 #: inc/class-spotim-settings-fields.php:239 
     123#: inc/class-spotim-settings-fields.php:245 
     124msgid "Spot ID" 
     125msgstr "" 
     126 
     127#: inc/class-spotim-settings-fields.php:261 
    127128msgid "Find your Spot ID at the <a href=\"%s\" target=\"_blank\">Spot.IM's Admin Dashboard</a> under \"Features\" section." 
    128 msgstr "" 
    129  
    130 #: inc/class-spotim-settings-fields.php:251 
    131 msgid "Spot ID" 
    132129msgstr "" 
    133130 
     
    136133msgstr "" 
    137134 
    138 #: inc/class-spotim-settings-fields.php:335 
     135#: inc/class-spotim-settings-fields.php:345 
    139136msgid "Display on %s" 
    140137msgstr "" 
    141138 
    142 #: inc/class-spotim-settings-fields.php:353 
    143 msgid "Enable Comments" 
    144 msgstr "" 
    145  
    146 #: inc/class-spotim-settings-fields.php:355 
    147 msgid "Enable Comments & Recirculation" 
    148 msgstr "" 
    149  
    150 #: inc/class-spotim-settings-fields.php:409 
    151 msgid "Import Options" 
    152 msgstr "" 
    153  
    154 #: inc/class-spotim-settings-fields.php:423 
     139#: inc/class-spotim-settings-fields.php:391 
     140msgid "Comments Per Page" 
     141msgstr "" 
     142 
     143#: inc/class-spotim-settings-fields.php:447 
     144msgid "Advanced Options" 
     145msgstr "" 
     146 
     147#: inc/class-spotim-settings-fields.php:461 
     148msgid "Plugin Secret Token" 
     149msgstr "" 
     150 
     151#: inc/class-spotim-settings-fields.php:475, inc/class-spotim-settings-fields.php:715 
     152msgid "Don't have a token? please send us an email to %s and get one." 
     153msgstr "" 
     154 
     155#: inc/class-spotim-settings-fields.php:489 
     156msgid "Embed Method" 
     157msgstr "" 
     158 
     159#: inc/class-spotim-settings-fields.php:505 
     160msgid "Replace WordPress Comments" 
     161msgstr "" 
     162 
     163#: inc/class-spotim-settings-fields.php:507 
     164msgid "Insert After the Content" 
     165msgstr "" 
     166 
     167#: inc/class-spotim-settings-fields.php:511 
     168msgid "Dafault method should be replacing WordPress Comments. If it's not working, insert Spot.IM after the comments." 
     169msgstr "" 
     170 
     171#: inc/class-spotim-settings-fields.php:525 
     172msgid "Display Priority" 
     173msgstr "" 
     174 
     175#: inc/class-spotim-settings-fields.php:539 
     176msgid "Set display priority among the items added by other plugin that use \"the_content\" filter." 
     177msgstr "" 
     178 
     179#: inc/class-spotim-settings-fields.php:557 
     180msgid "Container Class" 
     181msgstr "" 
     182 
     183#: inc/class-spotim-settings-fields.php:571 
     184msgid "Comments template container class. WordPress default class is \"comments-area\"." 
     185msgstr "" 
     186 
     187#: inc/class-spotim-settings-fields.php:585 
     188msgid "External Import" 
     189msgstr "" 
     190 
     191#: inc/class-spotim-settings-fields.php:601 
     192msgid "Facebook Comments" 
     193msgstr "" 
     194 
     195#: inc/class-spotim-settings-fields.php:603 
     196msgid "Disqus Comments" 
     197msgstr "" 
     198 
     199#: inc/class-spotim-settings-fields.php:605 
     200msgid "WordPress Comments" 
     201msgstr "" 
     202 
     203#: inc/class-spotim-settings-fields.php:609 
     204msgid "Import comments from external services." 
     205msgstr "" 
     206 
     207#: inc/class-spotim-settings-fields.php:623 
     208msgid "Disqus Identifier Structure" 
     209msgstr "" 
     210 
     211#: inc/class-spotim-settings-fields.php:639 
     212msgid "ID" 
     213msgstr "" 
     214 
     215#: inc/class-spotim-settings-fields.php:641 
     216msgid "Short URL" 
     217msgstr "" 
     218 
     219#: inc/class-spotim-settings-fields.php:643 
     220msgid "ID + Short URL (Default)" 
     221msgstr "" 
     222 
     223#: inc/class-spotim-settings-fields.php:647 
     224msgid "The structure of your Disqus identifier." 
     225msgstr "" 
     226 
     227#: inc/class-spotim-settings-fields.php:687 
     228msgid "WP Sync Options" 
     229msgstr "" 
     230 
     231#: inc/class-spotim-settings-fields.php:701 
    155232msgid "Import Token" 
    156233msgstr "" 
    157234 
    158 #: inc/class-spotim-settings-fields.php:437, inc/class-spotim-settings-fields.php:649 
    159 msgid "Don't have a token? please send us an email to %s and get one." 
    160 msgstr "" 
    161  
    162 #: inc/class-spotim-settings-fields.php:451 
     235#: inc/class-spotim-settings-fields.php:729 
    163236msgid "Posts Per Request" 
    164237msgstr "" 
    165238 
    166 #: inc/class-spotim-settings-fields.php:465 
     239#: inc/class-spotim-settings-fields.php:743 
    167240msgid "Amount of posts to retrieve in each request, depending on your server's strength." 
    168241msgstr "" 
    169242 
    170 #: inc/class-spotim-settings-fields.php:475, inc/helpers/class-spotim-form.php:239 
     243#: inc/class-spotim-settings-fields.php:761, inc/helpers/class-spotim-form.php:237 
    171244msgid "No" 
    172245msgstr "" 
    173246 
    174 #: inc/class-spotim-settings-fields.php:495 
     247#: inc/class-spotim-settings-fields.php:781 
    175248msgid "Auto Import" 
    176249msgstr "" 
    177250 
    178 #: inc/class-spotim-settings-fields.php:509 
     251#: inc/class-spotim-settings-fields.php:795 
    179252msgid "Enable auto-import and set how often should it reoccur." 
    180253msgstr "" 
    181254 
    182 #: inc/class-spotim-settings-fields.php:533 
     255#: inc/class-spotim-settings-fields.php:819 
    183256msgid "Manual Import" 
    184257msgstr "" 
    185258 
    186 #: inc/class-spotim-settings-fields.php:547 
     259#: inc/class-spotim-settings-fields.php:833 
    187260msgid "Import Now!" 
    188261msgstr "" 
    189262 
    190 #: inc/class-spotim-settings-fields.php:555 
     263#: inc/class-spotim-settings-fields.php:841 
    191264msgid "Cancel" 
    192265msgstr "" 
    193266 
    194 #: inc/class-spotim-settings-fields.php:621 
    195 msgid "Export Options" 
    196 msgstr "" 
    197  
    198 #: inc/class-spotim-settings-fields.php:635 
    199 msgid "Export Token" 
    200 msgstr "" 
    201  
    202 #: inc/helpers/class-spotim-form.php:223 
     267#: inc/helpers/class-spotim-form.php:221 
    203268msgid "Yes" 
    204269msgstr "" 
     
    233298 
    234299#: templates/admin-template.php:13 
    235 msgid "Import" 
     300msgid "Advanced" 
    236301msgstr "" 
    237302 
    238303#: templates/admin-template.php:15 
    239 msgid "Export" 
    240 msgstr "" 
     304msgid "WP Sync" 
     305msgstr "" 
     306 
     307#: templates/admin-template.php:17 
     308msgid "Spot.IM Dashboard" 
     309msgstr "" 
  • spotim-comments/trunk/readme.txt

    r1640492 r1697603  
    33Tags: Comment, comment form, commenting, comments, comment author, comment form, comment system, comment template, comments box, community, discuss, discussion, discussions, commenter, live update, real time, realtime, real-time, Spot.IM, reply, social login, widget, social, moderation, community, communities, engagement, Facebook, profile, sharing, newsfeed, chat, chat interface, notification, notifications, SEO, retention, pageviews, email alerts, direct message, direct messaging, group message, group messaging, content, content circulation, UGC, user generated content 
    44Requires at least: 4.0 
    5 Tested up to: 4.7 
    6 Stable tag: 4.0.4 
     5Tested up to: 4.8 
     6Stable tag: 4.1.0 
    77License: GPLv2 or later 
    88License URI: license.txt 
     
    6161* **@Mentions** – With a simple “@,” your community members can address each other within a conversation. Mentioned users get an actionable, mobile notification (still?) and an email alert even if he or she is offline. 
    6262* **Community Interfacing** – Beyond group and private messaging, users can like and share each other’s messages. 
    63 * **Gameification** – Spot.IM incentivizes your community by rewarding active contributors in your community with points and rankings. High-ranking community members push the level and flow of conversation. 
     63* **Gamification** – Spot.IM incentivizes your community by rewarding active contributors in your community with points and rankings. High-ranking community members push the level and flow of conversation. 
    6464* **Customization and Branding** – Make your community just that – yours – with a variety of customizable design options, including colors, schemes, and icons. 
    6565* **Moderation** – Advanced automatic, manual, and user moderation lets you eliminate trolls and spam, keeping your User Generated Content clean while allowing your star commenters to shine. 
     
    7171For more information, please visit our website – Spot.IM 
    7272 
    73 == Installation == 
    74  
    75 == Installation == 
    76  
    77 = Installation = 
    78 1. In your WordPress Dashboard go to "Plugins" -> "Add Plugin". 
    79 2. Search for "Spot.IM Comments". 
    80 3. Install the plugin by pressing the "Install" button. 
    81 4. Activate the plugin by pressing the "Activate" button. 
    82 5. Then go to the Spot.IM Plugin Synchronize page (Spot.IM > Synchronize) and then in the first step ("choose Onwer") select the admin user. 
    83 6. Send the exported data to support@spot.im alongside contact details. 
    84 7. Then go to the Spot.IM Plugin settings page (Spot.IM > Settings) and fill the Spot’s ID that You have recieved from step 5. 
    85  
    86 = Minimum Requirements = 
    87 * WordPress version 4.0 or greater. 
    88 * PHP version 5.2.4 or greater. 
    89 * MySQL version 5.0 or greater. 
    90  
    91 = Recommended Requirements = 
    92 * The latest WordPress version. 
    93 * PHP version 7.0 or greater. 
    94 * MySQL version 5.6 or greater. 
    95  
    9673== Screenshots == 
    9774 
     
    101784. Spot.IM Settings - Export tab. 
    102795. Spot.IM Meta Box - displayed on post, pages and other CPTs. 
    103 6. Spot.IM comments on site's fronend. 
     806. Spot.IM comments on site's frontend. 
    104817. Spot.IM on desktop and mobile. 
    105828. Spot.IM on tablet. 
     
    10986== Frequently Asked Questions == 
    11087 
    111 = Export data was finished but the donwload of exported file didn't start? = 
    112  
    113 Check the permission of the file `/plugin_dir/sample-data/export.json` or copy export text from textarea section on the fininsh step. 
     88= Installation Instructions = 
     891. In your WordPress Dashboard go to "Plugins" > "Add Plugin". 
     902. Search for "Spot.IM Comments". 
     913. Install the plugin by pressing the "Install" button. 
     924. Activate the plugin by pressing the "Activate" button. 
     935. Then go to the Spot.IM Plugin settings page (Spot.IM > Settings) and fill your Spot ID. 
     94 
     95= Plugin Requirements = 
     96 
     97**Minimum Requirements** 
     98 
     99* WordPress version 4.0 or greater. 
     100* PHP version 5.2.4 or greater. 
     101* MySQL version 5.0 or greater. 
     102 
     103**Recommended Requirements** 
     104 
     105* The latest WordPress version. 
     106* PHP version 7.0 or greater. 
     107* MySQL version 5.6 or greater. 
     108 
     109= How I can get Spot’s ID? = 
     110 
     111You can get it sending them exported data to support@spot.im alongside contact details. 
    114112 
    115113= If I don't set Spot’s ID what will happen? = 
    116114 
    117 The standart comment form will be used. 
    118  
    119 = How I can get Spot’s ID? = 
    120  
    121 You can get it sending them exported data to support@spot.im alongside contact details. 
     115The standard comment form will be used. 
    122116 
    123117= If I change Spot’s ID or selected owner what will be happen? = 
     
    129123You can remove the plugin and install it again. 
    130124 
    131 = Export data stop at X(any number)%? = 
    132  
    133 It happens when you have too many comments and memory of the server does not lack. Contact with your hosting provider support and ask them to increase php memory limit. Or you if you have PHP knowledge you can put code `define( 'WP_MEMORY_LIMIT', '256M' );` in your `wp-config.php` file. 
     125= Export data was finished but the download of exported file didn't start? = 
     126 
     127Check the permission of the file `/plugin_dir/sample-data/export.json` or copy export text from textarea section on the finish step. 
     128 
     129= Export data stop at XX%? = 
     130 
     131It happens when you have too many comments and memory of the server does not lack. Contact with your hosting provider support and ask them to increase PHP memory limit. Or you if you have PHP knowledge you can put code `define( 'WP_MEMORY_LIMIT', '256M' );` in your `wp-config.php` file. 
    134132 
    135133You can read more here https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP 
     
    195193= As a developer, how can I extend the plugin? = 
    196194 
    197 The plugin supports several hooks. Developers can use them to modify the default behavior. 
    198  
    199 **Comments Template**: 
    200  
    201 * `before_spotim_comments` - Befor loading SpotIM comments template. 
    202 * `after_spotim_comments` - After loading SpotIM comments template. 
    203  
    204 Both hooks recieve two paramarets: `$template` for the template to load ; `$spot_id` for the sites SpotIM ID. 
    205  
    206 **Recirculation Template**: 
    207  
    208 * `before_spotim_recirculation` - Befor loading SpotIM recirculation template. 
    209 * `after_spotim_recirculation` - After loading SpotIM recirculation template. 
    210  
    211 Both hooks recieve two paramarets: `$template` for the template to load ; `$spot_id` for the sites SpotIM ID. 
    212  
    213 **User capability to display settings**: 
    214  
    215 * `spotim_menu_display_capability` - Filter the required capability to display Spot.IM settings page. 
     195The plugin supports many hooks. Developers can use them to modify the default behavior. You can add elements to the comments and the recirculation template, alter required capabilities to display admin settings, change the value of each data attribute in the embed code, and more. 
    216196 
    217197= My question wasn’t answered here. Where can I get further support? = 
     
    222202 
    223203== Changelog == 
     204 
     205= 4.1.0 = 
     206* Fresh admin design. 
     207* Add new tab linking to Spot.IM Dashboard. 
     208* Add new "Advanced" tab. 
     209* Rename "Import" tab to "WP Sync". 
     210* Remove "Export" tab and the old export functionality. 
     211* Simpler display options per post type - either Enable or Disable spotim functionality. 
     212* Add the ability to control the number of comments displayed per page. 
     213* Add the ability to control the comments template container class. 
     214* Allow users to select the "Embed Method" and set the "Display Priority" 
     215* When migrating from Disqus, now you can set custom Disqus identifier structure. 
     216* When migrating from Facebook Comments, now the embed code has "data-facebook-url" attribute. 
     217* Add new "data-post-url" attribute to the embed code, with the post URL. 
     218* Add new "data-disqus-short-url" attribute to the embed code, with the post short URL. 
     219* Add new "data-wp-import-endpoint" attribute to the embed code, With "spotim" feed URL. 
     220* Add new feed type called "spotim", and a link to this feed from the embed code. 
     221* Hooks: Filter all the data attributes in embed template. 
     222* Backwards Compatibility: Fix singleton issue on `SpotIM_Options()` class. 
     223* Backwards Compatibility: Don't use short arrays syntax, to support sites using older PHP versions. 
     224* Backwards Compatibility: Fix `empty()` checks in for sites using older PHP versions. 
    224225 
    225226= 4.0.4 = 
     
    227228* Performance: Replace uncached query with cached query when running the import. 
    228229* Performance: Set max post per request to 100. 
    229 * Security: Prevent posible code injection vulnerabilities. 
     230* Security: Prevent possible code injection vulnerabilities. 
    230231* Hooks: Add `spotim_menu_display_capability` filter that allows developers to filter the required capability to display Spot.IM settings. 
    231232 
    232233= 4.0.3 = 
    233 * Bug Fix: update two files encoding to UTF-8 to fix a error on some servers / enviroments. 
     234* Bug Fix: update two files encoding to UTF-8 to fix a error on some servers / environments. 
    234235 
    235236= 4.0.2 = 
    236237* [Code review](https://vip.wordpress.com/documentation/) for "[WordPress.com VIP](https://vip.wordpress.com/)" clients. 
    237 * Security: Escaping HTML attributes and urls to prevent posible code injection vulnerabilities. 
     238* Security: Escaping HTML attributes and URLs to prevent possible code injection vulnerabilities. 
    238239* i18n: Merge similar translation strings. 
    239240 
     
    255256* Add gulp tasks for textdomain-check and pot-file-generation. 
    256257* i18n: Update wrong translation textdomains to match the plugin slug. 
    257 * i18n: Add missin translation functions to translation strings. 
     258* i18n: Add missing translation functions to translation strings. 
    258259* i18n: Use translate.wordpress.org to translate the plugin. 
    259 * Security: Escape translation strings to prevent posible code injection using PO/MO files. 
    260 * Security: Prevent direct access to php files. 
     260* Security: Escape translation strings to prevent possible code injection using PO/MO files. 
     261* Security: Prevent direct access to PHP files. 
    261262* Security: Prevent direct access to directories. 
    262263* Docs: Add phpDocs all over the code, to document everything. 
    263 * a11y: Remove depricated admin icon from the plugin settings page. 
     264* a11y: Remove deprecated admin icon from the plugin settings page. 
    264265* a11y: Replace `<h2>` with `<h1>` heading in the settings page. 
    265266 
    266267= 3.0.0 = 
    267 * Import comments from Spot.IM to Wordpress feature is out. 
     268* Import comments from Spot.IM to WordPress feature is out. 
    268269* Added features to options file. 
    269270* Restructure settings fields file. 
     
    271272 
    272273= 2.1.1 = 
    273 * Rearrange escaping and sanitisation to the end of the functions. 
     274* Rearrange escaping and sanitization to the end of the functions. 
    274275 
    275276= 2.1.0 = 
     
    277278* Change the way we use templates and require templates. 
    278279* Validating, sanitizing, and escaping user data. 
    279 * Remove lang slug variable and replaced it with the string. 
     280* Remove `lang` slug variable and replaced it with the string. 
    280281* More information - https://github.com/SpotIM/wordpress-comments-plugin/pull/1 
    281282 
    282283= 2.0.3 = 
    283 * Change javascript loader. 
     284* Change JavaScript loader. 
    284285 
    285286= 2.0.2 = 
     
    293294 
    294295= 1.10.6 = 
    295 * Fix a bug with an api. 
     296* Fix a bug with an API. 
    296297 
    297298= 1.10.5 = 
    298 * Move plugin's script from wp_head to wp_footer hook 
     299* Move plugin's script from `wp_head` to `wp_footer` hook 
    299300* Fix a bug with filter comments number 
    300301 
     
    306307 
    307308= 1.10.1 = 
    308 * Updated to use wp_new_comment function 
     309* Updated to use `wp_new_comment()` function 
    309310 
    310311= 1.10.1 = 
    311 * Updated to use home_url() 
     312* Updated to use `home_url()`` 
    312313 
    313314= 1.10.0 = 
    314 * Updated to use conversation_url during comment sync from Spot.IM 
     315* Updated to use `conversation_url` during comment sync from Spot.IM 
    315316 
    316317= 1.0.9 = 
     
    324325 
    325326= 1.0.6 = 
    326 * Added disqus identifier and url tags 
     327* Added Disqus identifier and URL tags 
    327328 
    328329= 1.0.5 = 
  • spotim-comments/trunk/spotim-comments.php

    r1640492 r1697603  
    44 * Plugin URI:          https://wordpress.org/plugins/spotim-comments/ 
    55 * Description:         Real-time comments widget turns your site into its own content-circulating ecosystem. 
    6  * Version:             4.0.4 
     6 * Version:             4.1.0 
    77 * Author:              Spot.IM 
    88 * Author URI:          https://github.com/SpotIM 
     
    1515// Exit if accessed directly 
    1616if ( ! defined( 'ABSPATH' ) ) { 
    17     exit; 
     17    exit; 
    1818} 
    1919 
     
    2222require_once( 'inc/helpers/class-spotim-message.php' ); 
    2323require_once( 'inc/helpers/class-spotim-comment.php' ); 
     24require_once( 'inc/helpers/class-spotim-json-feed.php' ); 
    2425require_once( 'inc/class-spotim-i18n.php' ); 
    25 require_once( 'inc/class-spotim-endpoint.php' ); 
    26 require_once( 'inc/class-spotim-export.php' ); 
    2726require_once( 'inc/class-spotim-import.php' ); 
    2827require_once( 'inc/class-spotim-options.php' ); 
     
    3130require_once( 'inc/class-spotim-admin.php' ); 
    3231require_once( 'inc/class-spotim-frontend.php' ); 
     32require_once( 'inc/class-spotim-feed.php' ); 
    3333require_once( 'inc/class-spotim-cron.php' ); 
    3434require_once( 'inc/spotim-shortcodes.php' ); 
     
    6666     */ 
    6767    protected function __construct() { 
     68 
     69        // Activation/Deactivation hooks 
     70        register_activation_hook( __FILE__, array( $this, 'flush_rewrite_rules' ) ); 
     71        register_deactivation_hook( __FILE__, array( $this, 'flush_rewrite_rules' ) ); 
     72 
     73        // Get the Options 
    6874        $this->options = SpotIM_Options::get_instance(); 
    6975 
     76        // Run the plugin 
    7077        new SpotIM_i18n(); 
    7178        new SpotIM_Cron( $this->options ); 
     79        new SpotIM_Feed(); 
    7280 
    7381        if ( is_admin() ) { 
    7482 
    75             // Launch Admin Page 
    76             SpotIM_Admin::launch( $this->options ); 
     83            // Admin Page 
     84            new SpotIM_Admin( $this->options ); 
    7785 
    7886        } else { 
    7987 
    80             // Launch frontend code: embed script, comments template, comments count. 
    81             SpotIM_Frontend::launch( $this->options ); 
     88            // Frontend code: embed script, comments template, comments count. 
     89            new SpotIM_Frontend( $this->options ); 
    8290 
    8391        } 
     
    101109 
    102110        return self::$instance; 
     111 
    103112    } 
     113 
     114    /** 
     115     * Flush rewrite rules 
     116     * 
     117     * @since 4.1.0 
     118     * 
     119     * @access public 
     120     * 
     121     * @return void 
     122     */ 
     123    public function flush_rewrite_rules() { 
     124        flush_rewrite_rules(); 
     125    } 
     126 
    104127} 
    105128 
  • spotim-comments/trunk/templates/admin-template.php

    r1640492 r1697603  
    33 
    44    <nav class="nav-tab-wrapper"> 
    5         <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=general' ); ?>" class="nav-tab <?php echo ( 'general' === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'General', 'spotim-comments' ); ?></a> 
    6         <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=display' ); ?>" class="nav-tab <?php echo ( 'display' === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Display', 'spotim-comments' ); ?></a> 
    7         <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=import'  ); ?>" class="nav-tab <?php echo ( 'import'  === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Import',  'spotim-comments' ); ?></a> 
    8         <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=export'  ); ?>" class="nav-tab <?php echo ( 'export'  === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Export',  'spotim-comments' ); ?></a> 
     5        <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=general'  ); ?>" class="nav-tab <?php echo ( 'general'  === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'General',  'spotim-comments' ); ?></a> 
     6        <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=display'  ); ?>" class="nav-tab <?php echo ( 'display'  === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Display',  'spotim-comments' ); ?></a> 
     7        <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=advanced' ); ?>" class="nav-tab <?php echo ( 'advanced' === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Advanced', 'spotim-comments' ); ?></a> 
     8        <a href="<?php echo esc_attr( '?page=' . $this->slug . '&tab=import'   ); ?>" class="nav-tab <?php echo ( 'import'   === $this->active_tab ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'WP Sync',  'spotim-comments' ); ?></a> 
     9        <a href="https://admin.spot.im/" class="nav-tab pull-to-end" target="_blank"><?php esc_html_e( 'Spot.IM Dashboard', 'spotim-comments' ); ?></a> 
    910    </nav> 
    1011 
  • spotim-comments/trunk/templates/comments-template.php

    r1592365 r1697603  
    1 <div class="spot-im-comments comments-area"> 
    2     <div class="spot-im-frame-inpage" data-post-id="<?php echo esc_attr( get_the_ID() ); ?>" data-disqus-url="<?php echo esc_url( get_permalink() ); ?>" data-disqus-identifier="<?php the_ID(); ?> <?php echo esc_url( site_url() ); ?>/?p=<?php the_ID(); ?>" data-community-question="<?php echo esc_attr( get_post_meta( get_the_id(), 'spotim_display_question', true ) ); ?>"> 
     1<?php 
     2$options = SpotIM_Options::get_instance(); 
     3switch( $options->get( 'disqus_identifier' ) ) { 
     4    case 'id': 
     5        $disqus_identifier = get_the_id(); 
     6        break; 
     7    case 'short_url': 
     8        $disqus_identifier = esc_url( site_url( '/?p=' . get_the_id() ) ); 
     9        break; 
     10    case 'id_short_url': 
     11    default: 
     12        $disqus_identifier = get_the_id() . ' ' . esc_url( site_url( '/?p=' . get_the_id() ) ); 
     13} 
     14?> 
     15<div class="spot-im-comments <?php echo esc_attr( apply_filters( 'spotim_comments_class', $options->get( 'class' ) ) ); ?>"> 
     16    <div class="spot-im-frame-inpage" 
     17        data-post-id="<?php echo esc_attr( apply_filters( 'spotim_comments_post_id', get_the_ID() ) ); ?>" 
     18        data-post-url="<?php echo esc_url( apply_filters( 'spotim_comments_post_url', get_permalink() ) ); ?>" 
     19        data-messages-count="<?php echo esc_attr( apply_filters( 'spotim_comments_messages_count', $options->get( 'comments_per_page' ) ) ); ?>" 
     20        data-wp-import-endpoint="<?php echo esc_url( apply_filters( 'spotim_comments_feed_link', get_post_comments_feed_link( get_the_id(), 'spotim' ) ) ); ?>" 
     21        data-facebook-url="<?php echo esc_url( apply_filters( 'spotim_comments_facebook_url', get_permalink() ) ); ?>" 
     22        data-disqus-url="<?php echo esc_url( apply_filters( 'spotim_comments_disqus_url', get_permalink() ) ); ?>" 
     23        data-disqus-short-url="<?php echo esc_url( apply_filters( 'spotim_comments_disqus_short_url', site_url( '/?p=' . get_the_id() ) ) ); ?>" 
     24        data-disqus-identifier="<?php echo apply_filters( 'spotim_comments_disqus_identifier', $disqus_identifier ); ?>" 
     25        data-community-question="<?php echo esc_attr( apply_filters( 'spotim_comments_community_question',  get_post_meta( get_the_id(), 'spotim_display_question', true ) ) ); ?>"> 
    326    </div> 
    427</div> 
Note: See TracChangeset for help on using the changeset viewer.