Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alimir committed Apr 14, 2022
2 parents 1079560 + d900820 commit 9c8686d
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 46 deletions.
2 changes: 1 addition & 1 deletion admin/assets/js/plugins.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions admin/settings/assets/js/gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
var RawHTML = element.RawHTML;
var Button = components.Button;

registerBlockType('ulf-gutenberg-block/block-'+block.hash, {
registerBlockType(block.name, {
title: block.gutenberg.title,
description: block.gutenberg.description,
icon: block.gutenberg.icon || 'screenoptions',
Expand All @@ -43,7 +43,7 @@

createElement(Button, {
'data-modal-id': block.modal_id,
'data-gutenberg-id': block.hash,
'data-gutenberg-id': block.name,
className: 'is-secondary ulf-shortcode-button',
onClick: function () {
window.ulf_gutenberg_props = props;
Expand Down
4 changes: 2 additions & 2 deletions admin/settings/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2613,14 +2613,14 @@
}

if ( sub_shortcode_value !== '' ) {
shortcode += ' ' + sub_shortcode_tag.replace('-', '_') + '="' + sub_shortcode_value.toString() + '"';
shortcode += ' ' + sub_shortcode_tag + '="' + sub_shortcode_value.toString() + '"';
}

});

} else {

shortcode += ' ' + shortcode_tag.replace('-', '_') + '="' + shortcode_value.toString() + '"';
shortcode += ' ' + shortcode_tag + '="' + shortcode_value.toString() + '"';

}

Expand Down
4 changes: 2 additions & 2 deletions admin/settings/assets/js/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/settings/assets/js/plugins.min.js

Large diffs are not rendered by default.

43 changes: 29 additions & 14 deletions admin/settings/classes/setup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* @version 1.0.0
*
*/
if ( ! class_exists( 'ULF' ) ) {
class ULF {
if ( ! class_exists( 'ULF_Setup' ) ) {
class ULF_Setup {

// Default constants
public static $premium = true;
public static $version = '2.2.7';
public static $version = '2.2.8';
public static $dir = '';
public static $url = '';
public static $css = '';
Expand All @@ -39,11 +39,14 @@ class ULF {

private static $instance = null;

public static function init( $file = __FILE__ ) {
public static function init( $file = __FILE__, $premium = true ) {

// Set file constant
self::$file = $file;

// Set file constant
self::$premium = $premium;

// Set constants
self::constants();

Expand Down Expand Up @@ -375,18 +378,18 @@ public static function include_plugin_url( $file ) {
// Include files
public static function includes() {

// Helpers
// Include common functions
self::include_plugin_file( 'functions/actions.php' );
self::include_plugin_file( 'functions/helpers.php' );
self::include_plugin_file( 'functions/sanitize.php' );
self::include_plugin_file( 'functions/validate.php' );

// Includes free version classes
// Include free version classes
self::include_plugin_file( 'classes/abstract.class.php' );
self::include_plugin_file( 'classes/fields.class.php' );
self::include_plugin_file( 'classes/admin-options.class.php' );

// Includes premium version classes
// Include premium version classes
if ( self::$premium ) {
self::include_plugin_file( 'classes/customize-options.class.php' );
self::include_plugin_file( 'classes/metabox-options.class.php' );
Expand Down Expand Up @@ -560,9 +563,6 @@ public static function add_admin_enqueue_scripts() {
return;
}

// Check for developer mode
$min = ( self::$premium && SCRIPT_DEBUG ) ? '' : '.min';

// Admin utilities
wp_enqueue_media();

Expand All @@ -572,12 +572,15 @@ public static function add_admin_enqueue_scripts() {

// Font awesome 4 and 5 loader
if ( apply_filters( 'ulf_fa4', false ) ) {
wp_enqueue_style( 'ulf-fa', 'https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome'. $min .'.css', array(), '4.7.0', 'all' );
wp_enqueue_style( 'ulf-fa', 'https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css', array(), '4.7.0', 'all' );
} else {
wp_enqueue_style( 'ulf-fa5', 'https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all'. $min .'.css', array(), '5.15.5', 'all' );
wp_enqueue_style( 'ulf-fa5-v4-shims', 'https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/v4-shims'. $min .'.css', array(), '5.15.5', 'all' );
wp_enqueue_style( 'ulf-fa5', 'https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css', array(), '5.15.5', 'all' );
wp_enqueue_style( 'ulf-fa5-v4-shims', 'https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/v4-shims.min.css', array(), '5.15.5', 'all' );
}

// Check for developer mode
$min = ( self::$premium && SCRIPT_DEBUG ) ? '' : '.min';

// Main style
wp_enqueue_style( 'ulf', self::include_plugin_url( 'assets/css/style'. $min .'.css' ), array(), self::$version, 'all' );

Expand Down Expand Up @@ -783,4 +786,16 @@ public static function field( $field = array(), $value = '', $unique = '', $wher

}

ULF::init( __FILE__ );
ULF_Setup::init( __FILE__, true );

/**
*
* Extended Setup Class for Shortland
*
* @since 1.0.0
* @version 1.0.0
*
*/
if ( ! class_exists( 'ULF' ) ) {
class ULF extends ULF_Setup{}
}
8 changes: 5 additions & 3 deletions admin/settings/classes/shortcode-options.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public function __construct( $key, $params = array() ) {

if ( ! empty( $this->args['show_in_editor'] ) ) {

ULF::$shortcode_instances[$this->unique] = wp_parse_args( array( 'hash' => md5( $key ), 'modal_id' => $this->unique ), $this->args );
$name = str_replace( '_', '-', sanitize_title( $this->unique ) );

ULF::$shortcode_instances[] = wp_parse_args( array( 'name' => 'ulf/'. $name, 'modal_id' => $this->unique ), $this->args );

// elementor editor support
if ( ULF::is_active_plugin( 'elementor/elementor.php' ) ) {
Expand Down Expand Up @@ -322,9 +324,9 @@ public static function add_guteberg_blocks() {

wp_localize_script( 'ulf-gutenberg-block', 'ulf_gutenberg_blocks', ULF::$shortcode_instances );

foreach ( ULF::$shortcode_instances as $value ) {
foreach ( ULF::$shortcode_instances as $block ) {

register_block_type( 'ulf-gutenberg-block/block-'. $value['hash'], array(
register_block_type( $block['name'], array(
'editor_script' => 'ulf-gutenberg-block',
) );

Expand Down
2 changes: 1 addition & 1 deletion assets/js/wp-ulike.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WP ULike - v4.6.0
/*! WP ULike - v4.6.1
* https://wpulike.com
* TechnoWich 2022;
*/
Expand Down
2 changes: 1 addition & 1 deletion assets/js/wp-ulike.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions includes/hooks/third-party.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ function wp_ulike_add_bp_notifications( $cp_ID, $type, $user_ID, $status, $has_l
* @return string $return Formatted notification.
*/
function wp_ulike_format_buddypress_notifications( $content, $item_id, $secondary_item_id, $total_items, $format, $action, $component, $id ) {
global $wp_filter,$wp_version;

// check for ulike notifications
if ( strpos( $action, 'wp_ulike_' ) !== false ) {
//Extracting ulike type from the action value.
preg_match('/wp_ulike_(.*?)_action/', $action, $type);
Expand Down Expand Up @@ -403,19 +402,6 @@ function wp_ulike_format_buddypress_notifications( $content, $item_id, $secondar
'link' => $custom_link
), $custom_link, (int) $total_items, $item_id, $user_ID );
}

if ( function_exists('bbp_get_version') && version_compare( bbp_get_version(), '2.6.0' , '<') ) {
// global wp_filter to call bbPress wrapper function
if( isset( $wp_filter['bp_notifications_get_notifications_for_user'][10]['bbp_format_buddypress_notifications'] ) ) {
if( version_compare( $wp_version, '4.7', '>=' ) ) {
$wp_filter['bp_notifications_get_notifications_for_user']->callbacks[10]['bbp_format_buddypress_notifications']['function'] = 'wp_ulike_bbp_format_buddypress_notifications';
} else {
$wp_filter['bp_notifications_get_notifications_for_user'][10]['bbp_format_buddypress_notifications']['function'] = 'wp_ulike_bbp_format_buddypress_notifications';
}
}
}

return $content;
}

return $content;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wp-ulike",
"title": "WP ULike",
"version": "4.6.0",
"version": "4.6.1",
"description": "WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.",
"homepage": "https://wpulike.com",
"repository": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: like, marketing, elementor, user profile, rating, favorite, statistics, bu
Requires PHP: 5.6
Requires at least: 5.0
Tested up to: 5.9.3
Stable tag: 4.6.0
Stable tag: 4.6.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -140,6 +140,10 @@ Yes, WP ULike is compatible with Apache, Nginx, Microsoft IIS et LiteSpeed web s

== Changelog ==

= 4.6.1 =
* Updated: Options panel framework.
* Fixed: BuddyPress notification error.

= 4.6.0 =
* Added: Increase security for user accounts by using 2-factor authentication steps. [PRO]
* Added: Animated Smiley Switch Template. [PRO]
Expand Down
4 changes: 2 additions & 2 deletions wp-ulike.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP ULike
* Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
* Description: Receiving feedback is crucial as a content creator, but unfortunately, the pieces of content you can collect it on are limited by default. However, with the help of the WP ULike plugin, it is possible to cast voting to any type of content you may have on your website. With outstanding and eye-catching widgets, you can have Like and Dislike Button on all of your content would it be a post, comment, BuddyPress activity, bbPress topics, WooCommerce products, you name it. Now you can feel your users Love for each part of your work.
* Version: 4.6.0
* Version: 4.6.1
* Author: TechnoWich
* Author URI: https://technowich.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
* Text Domain: wp-ulike
Expand All @@ -27,7 +27,7 @@

// Do not change these values
define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
define( 'WP_ULIKE_VERSION' , '4.6.0' );
define( 'WP_ULIKE_VERSION' , '4.6.1' );
define( 'WP_ULIKE_DB_VERSION' , '2.3' );
define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ) );
Expand Down

0 comments on commit 9c8686d

Please sign in to comment.