Changeset 2604330
- Timestamp:
- 09/24/2021 01:52:04 PM (5 years ago)
- Location:
- free-comments-for-wordpress-vuukle/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
free-comments-for-wordpress-vuukle.php (modified) (2 diffs)
-
public/class-free-comments-for-wordpress-vuukle-public.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
free-comments-for-wordpress-vuukle/trunk/README.txt
r2603146 r2604330 4 4 Requires at least: 2.0.2 5 5 Tested up to: 5.8 6 Stable tag: 5.0. 36 Stable tag: 5.0.4 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 172 172 == Changelog == 173 173 174 = 5.0.4 = 175 176 * Tracking option homepage bug fixed 177 174 178 = 5.0.3 = 175 179 -
free-comments-for-wordpress-vuukle/trunk/free-comments-for-wordpress-vuukle.php
r2603146 r2604330 19 19 * Plugin URI: https://vuukle.com 20 20 * 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. 321 * Version: 5.0.4 22 22 * Author: Vuukle 23 23 * Author URI: https://vuukle.com … … 71 71 */ 72 72 function 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__ ) ); 74 74 $plugin->run(); 75 75 } -
free-comments-for-wordpress-vuukle/trunk/public/class-free-comments-for-wordpress-vuukle-public.php
r2603004 r2604330 18 18 * enqueue the public-facing stylesheet and JavaScript. 19 19 * 20 * @property array|null settings20 * @property array|null settings 21 21 * @property string|null app_id 22 22 * @category PHP … … 233 233 * This function creates a block for shortcode. 234 234 * 235 * @param string $attrthis is attributes236 * @param string $contentthis is content235 * @param string $attr this is attributes 236 * @param string $content this is content 237 237 * 238 238 * @return string … … 263 263 * This function adds scripts in the front. 264 264 * 265 * @param string $contentthis is a content265 * @param string $content this is a content 266 266 * 267 267 * @return string … … 269 269 */ 270 270 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 ] ) ) ) { 274 274 ob_start(); 275 275 global $post; … … 287 287 * Check vuukle availability for the current content 288 288 * 289 * @param bool $check_singlechecks if needed to proceed is_single check289 * @param bool $check_single checks if needed to proceed is_single check 290 290 * 291 291 * @return bool … … 300 300 return false; 301 301 } 302 /** 303 * Retrieve global post 304 * Check if it is valid WP_Post object 305 */ 302 // Retrieve global post 306 303 global $post; 304 // Check if it is valid WP_Post object 307 305 if ( empty( $post ) || ! ( $post instanceof WP_Post ) ) { 308 306 return false; 309 307 } 310 if ( empty( $this->availability ) ) {308 if ( is_null( $this->availability ) ) { 311 309 if ( empty( $this->app_id ) ) { 312 310 $this->availability = false; … … 314 312 return $this->availability; 315 313 } 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 } 333 337 } 334 338 // 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 } 341 347 } 342 348 // 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 } 354 361 $this->availability = true; 355 362 } … … 362 369 * This function adds emote. 363 370 * 364 * @param string $contentthis is a content371 * @param string $content this is a content 365 372 * 366 373 * @return string
Note: See TracChangeset
for help on using the changeset viewer.