Plugin Directory

Changeset 2604330


Ignore:
Timestamp:
09/24/2021 01:52:04 PM (5 years ago)
Author:
vuukle
Message:

5.0.4 trunk release

Location:
free-comments-for-wordpress-vuukle/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • free-comments-for-wordpress-vuukle/trunk/README.txt

    r2603146 r2604330  
    44Requires at least: 2.0.2
    55Tested up to: 5.8
    6 Stable tag: 5.0.3
     6Stable tag: 5.0.4
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    172172== Changelog ==
    173173
     174= 5.0.4 =
     175
     176* Tracking option homepage bug fixed
     177
    174178= 5.0.3 =
    175179
  • free-comments-for-wordpress-vuukle/trunk/free-comments-for-wordpress-vuukle.php

    r2603146 r2604330  
    1919 * Plugin URI:        https://vuukle.com
    2020 * Description:       Vuukle is the smartest commenting platform that offers AI-powered commenting, Unique Sharing tool bar, Emoji reaction widget and real time analytics with just one click. Customize all you want, make your pages load faster and experience user engagement like never before!
    21  * Version:           5.0.3
     21 * Version:           5.0.4
    2222 * Author:            Vuukle
    2323 * Author URI:        https://vuukle.com
     
    7171 */
    7272function Run_Free_Comments_For_Wordpress_vuukle() {
    73     $plugin = new Free_Comments_For_Wordpress_Vuukle( '5.0.3', plugin_dir_path( __FILE__ ), plugin_dir_url( __FILE__ ), plugin_basename( __FILE__ ) );
     73    $plugin = new Free_Comments_For_Wordpress_Vuukle( '5.0.4', plugin_dir_path( __FILE__ ), plugin_dir_url( __FILE__ ), plugin_basename( __FILE__ ) );
    7474    $plugin->run();
    7575}
  • free-comments-for-wordpress-vuukle/trunk/public/class-free-comments-for-wordpress-vuukle-public.php

    r2603004 r2604330  
    1818 * enqueue the public-facing stylesheet and JavaScript.
    1919 *
    20  * @property array|null settings
     20 * @property array|null  settings
    2121 * @property string|null app_id
    2222 * @category   PHP
     
    233233     * This function creates a block for shortcode.
    234234     *
    235      * @param string $attr this is attributes
    236      * @param string $content this is content
     235     * @param   string  $attr    this is attributes
     236     * @param   string  $content this is content
    237237     *
    238238     * @return string
     
    263263     * This function adds scripts in the front.
    264264     *
    265      * @param string $content this is a content
     265     * @param   string  $content this is a content
    266266     *
    267267     * @return string
     
    269269     */
    270270    public function commentBox( $content ) {
    271         if ( $this->checkAvailability() &&
    272              $this->settings['enabled_comments'] == 'true' &&
    273              ( in_array( $this->settings['embed_comments'], [ 1, 2, 3, 4 ] ) ) ) {
     271        if ( $this->checkAvailability()
     272             && $this->settings['enabled_comments'] == 'true'
     273             && ( in_array( $this->settings['embed_comments'], [ 1, 2, 3, 4 ] ) ) ) {
    274274            ob_start();
    275275            global $post;
     
    287287     * Check vuukle availability for the current content
    288288     *
    289      * @param bool $check_single checks if needed to proceed is_single check
     289     * @param   bool  $check_single checks if needed to proceed is_single check
    290290     *
    291291     * @return bool
     
    300300            return false;
    301301        }
    302         /**
    303          * Retrieve global post
    304          * Check if it is valid WP_Post object
    305          */
     302        // Retrieve global post
    306303        global $post;
     304        // Check if it is valid WP_Post object
    307305        if ( empty( $post ) || ! ( $post instanceof WP_Post ) ) {
    308306            return false;
    309307        }
    310         if ( empty( $this->availability ) ) {
     308        if ( is_null( $this->availability ) ) {
    311309            if ( empty( $this->app_id ) ) {
    312310                $this->availability = false;
     
    314312                return $this->availability;
    315313            }
    316             $post_exceptions     = explode( ',', $this->settings['post_exceptions'] );
    317             $post_exceptions     = array_map( 'trim', $post_exceptions );
    318             $category_exceptions = explode( ',', $this->settings['category_exceptions'] );
    319             $category_exceptions = array_map( 'trim', $category_exceptions );
    320             $post_categories     = get_the_category( $post->ID );
    321             foreach ( $post_categories as $key => $category ) {
    322                 $post_categories[ $key ] = $category->slug;
    323             }
    324             if ( in_array( (string) $post->ID, $post_exceptions, true ) ) {
    325                 $this->availability = false;
    326 
    327                 return $this->availability;
    328             }
    329             if ( count( array_intersect( $category_exceptions, $post_categories ) ) ) {
    330                 $this->availability = false;
    331 
    332                 return $this->availability;
     314            // Post exceptions
     315            if ( ! empty( $this->settings['post_exceptions'] ) ) {
     316                $post_exceptions = explode( ',', $this->settings['post_exceptions'] );
     317                $post_exceptions = array_map( 'trim', $post_exceptions );
     318                if ( in_array( (string) $post->ID, $post_exceptions, true ) ) {
     319                    $this->availability = false;
     320
     321                    return $this->availability;
     322                }
     323            }
     324            // Category exceptions
     325            if ( ! empty( $this->settings['category_exceptions'] ) ) {
     326                $category_exceptions = explode( ',', $this->settings['category_exceptions'] );
     327                $category_exceptions = array_map( 'trim', $category_exceptions );
     328                $post_categories     = get_the_category( $post->ID );
     329                foreach ( $post_categories as $key => $category ) {
     330                    $post_categories[ $key ] = $category->slug;
     331                }
     332                if ( count( array_intersect( $category_exceptions, $post_categories ) ) ) {
     333                    $this->availability = false;
     334
     335                    return $this->availability;
     336                }
    333337            }
    334338            // Post type exceptions
    335             $post_type_exceptions = explode( ',', $this->settings['post_type_exceptions'] );
    336             $post_type_exceptions = array_map( 'trim', $post_type_exceptions );
    337             if ( in_array( (string) $post->post_type, $post_type_exceptions, true ) ) {
    338                 $this->availability = false;
    339 
    340                 return $this->availability;
     339            if ( ! empty( $this->settings['post_type_exceptions'] ) ) {
     340                $post_type_exceptions = explode( ',', $this->settings['post_type_exceptions'] );
     341                $post_type_exceptions = array_map( 'trim', $post_type_exceptions );
     342                if ( in_array( (string) $post->post_type, $post_type_exceptions, true ) ) {
     343                    $this->availability = false;
     344
     345                    return $this->availability;
     346                }
    341347            }
    342348            // Post type by URL exceptions
    343             $post_type_by_url_exceptions = explode( ',', $this->settings['post_type_by_url_exceptions'] );
    344             $post_type_by_url_exceptions = array_map( function ( $item ) {
    345                 return trim( $item, ',/' );
    346             }, $post_type_by_url_exceptions );
    347             $link                        = str_replace( home_url(), '', get_permalink() );
    348             if ( in_array( trim( (string) $link, '/' ), $post_type_by_url_exceptions, true ) ) {
    349                 $this->availability = false;
    350 
    351                 return $this->availability;
    352             }
    353 
     349            if ( ! empty( $this->settings['post_type_by_url_exceptions'] ) ) {
     350                $post_type_by_url_exceptions = explode( ',', $this->settings['post_type_by_url_exceptions'] );
     351                $post_type_by_url_exceptions = array_map( function ( $item ) {
     352                    return trim( $item, ',/' );
     353                }, $post_type_by_url_exceptions );
     354                $link                        = str_replace( home_url(), '', get_permalink() );
     355                if ( in_array( trim( (string) $link, '/' ), $post_type_by_url_exceptions, true ) ) {
     356                    $this->availability = false;
     357
     358                    return $this->availability;
     359                }
     360            }
    354361            $this->availability = true;
    355362        }
     
    362369     * This function adds emote.
    363370     *
    364      * @param string $content this is a content
     371     * @param   string  $content this is a content
    365372     *
    366373     * @return string
Note: See TracChangeset for help on using the changeset viewer.