Skip to content

Commit

Permalink
Merge pull request #134 from brainstormforce/release-candidate
Browse files Browse the repository at this point in the history
Build Version 1.5.12
  • Loading branch information
sushmak02 authored Oct 1, 2024
2 parents 52bd2f0 + a926902 commit 9ac3057
Show file tree
Hide file tree
Showing 92 changed files with 10,718 additions and 1,140 deletions.
3 changes: 3 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Gruntfile.js
package.json
phpunit.xml
phpunit.xml.dist
phpstan-baseline.neon
phpstan.neon
stubs-generator.php
multisite.xml
multisite.xml.dist
phpcs.xml
Expand Down
3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module.exports = function( grunt ) {
'!composer.json',
'!composer.lock',
'!package-lock.json',
'!phpstan-baseline.neon',
'!phpstan.neon',
'!stubs-generator.php',
'!phpcs.xml.dist',
],
dest: 'ultimate-addons-for-beaver-builder-lite/'
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Ultimate Addons for Beaver Builder - Lite #
**Contributors:** [brainstormforce](https://profiles.wordpress.org/brainstormforce/)
**Donate link:** https://www.paypal.me/BrainstormForce
**Tags:** beaver builder, beaver builder free, beaver addons, beaver builder addon, beaver builder add ons, beaver builder lite, beaver builder modules, beaver builder addons, beaver builder extensions, beaver addon, beaver builder plugin, beaver builder wordpress
**Tags:** beaver builder, beaver builder free, beaver builder lite, beaver builder addons, beaver builder extensions
**Requires at least:** 4.6
**Tested up to:** 6.6
**Stable tag:** 1.5.11
**Stable tag:** 1.5.12
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -215,6 +215,10 @@ Yes it is! This plugin comes with .po and .mo files. It is already translated in

## Changelog ##

### 1.5.12 ###
* Improvement: Improved code quality syntax and security checks for better coding standards and practices.
* Fixed: Info List - Icon overlap issue.

### 1.5.11 ###
* Improvement: Hardened the security of plugin.
* Improvement: Compatibility with Beaver Builder 2.9
Expand Down
4 changes: 2 additions & 2 deletions admin/bsf-analytics/class-bsf-analytics-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function get_default_stats() {
/**
* Get installed PHP version.
*
* @return float PHP version.
* @return string PHP version.
* @since 1.0.0
*/
private function get_php_version() {
Expand Down Expand Up @@ -233,7 +233,7 @@ private function is_content_writable() {
/**
* Get timezone string.
*
* @return string timezone string.
* @return mixed timezone string.
* @since 1.0.0
*/
function wp_timezone_string() {
Expand Down
30 changes: 23 additions & 7 deletions admin/bsf-analytics/class-bsf-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct() {

define( 'BSF_ANALYTICS_FILE', __FILE__ );
define( 'BSF_ANALYTICS_VERSION', '1.0.1' );
define( 'BSF_ANALYTICS_PATH', dirname( __FILE__ ) );
define( 'BSF_ANALYTICS_PATH', __DIR__ );
define( 'BSF_ANALYTICS_URI', $this->bsf_analytics_url() );

add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
Expand Down Expand Up @@ -64,13 +64,13 @@ public function __construct() {
*/
public function bsf_analytics_url() {

$path = wp_normalize_path( BSF_ANALYTICS_PATH );
$path = wp_normalize_path( defined( 'BSF_ANALYTICS_PATH' ) ? BSF_ANALYTICS_PATH : '' );
$theme_dir = wp_normalize_path( get_template_directory() );

if ( strpos( $path, $theme_dir ) !== false ) {
return rtrim( get_template_directory_uri() . '/admin/bsf-analytics/', '/' );
} else {
return rtrim( plugin_dir_url( BSF_ANALYTICS_FILE ), '/' );
return rtrim( plugin_dir_url( defined( 'BSF_ANALYTICS_FILE' ) ? BSF_ANALYTICS_FILE : '' ), '/' );
}
}

Expand Down Expand Up @@ -101,15 +101,16 @@ public function enqueue_assets() {
$file_rtl = ( is_rtl() ) ? '-rtl' : '';
$css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';

$css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
$css_uri = ( defined( 'BSF_ANALYTICS_URI' ) ? BSF_ANALYTICS_URI : '' ) . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;

wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, ( defined( 'BSF_ANALYTICS_VERSION' ) ? BSF_ANALYTICS_VERSION : '' ), 'all' );
}

/**
* Send analytics API call.
*
* @since 1.0.0
* @return void
*/
public function send() {
wp_remote_post(
Expand Down Expand Up @@ -162,6 +163,7 @@ public function is_white_label_enabled() {
* Display admin notice for usage tracking.
*
* @since 1.0.0
* @return void
*/
public function option_notice() {

Expand Down Expand Up @@ -236,6 +238,7 @@ public function option_notice() {
* Process usage tracking opt out.
*
* @since 1.0.0
* @return void
*/
public function handle_optin_optout() {
if ( ! isset( $_GET['bsf_analytics_nonce'] ) ) {
Expand Down Expand Up @@ -268,6 +271,7 @@ public function handle_optin_optout() {
* Opt in to usage tracking.
*
* @since 1.0.0
* @return void
*/
private function optin() {
update_site_option( 'bsf_analytics_optin', 'yes' );
Expand All @@ -277,6 +281,7 @@ private function optin() {
* Opt out to usage tracking.
*
* @since 1.0.0
* @return void
*/
private function optout() {
update_site_option( 'bsf_analytics_optin', 'no' );
Expand All @@ -287,6 +292,7 @@ private function optout() {
*
* @param array $schedules scheduled array data.
* @since 1.0.0
* @return array
*/
public function every_two_days_schedule( $schedules ) {
$schedules['every_two_days'] = array(
Expand All @@ -301,6 +307,7 @@ public function every_two_days_schedule( $schedules ) {
* Schedule usage tracking event.
*
* @since 1.0.0
* @return void
*/
private function schedule_event() {
if ( ! wp_next_scheduled( 'bsf_analytics_send' ) && $this->is_tracking_enabled() ) {
Expand All @@ -312,6 +319,7 @@ private function schedule_event() {
* Unschedule usage tracking event.
*
* @since 1.0.0
* @return void
*/
private function unschedule_event() {
wp_clear_scheduled_hook( 'bsf_analytics_send' );
Expand All @@ -321,6 +329,7 @@ private function unschedule_event() {
* Load analytics stat class.
*
* @since 1.0.0
* @return void
*/
private function includes() {
require_once __DIR__ . '/class-bsf-analytics-stats.php';
Expand All @@ -330,6 +339,7 @@ private function includes() {
* Register usage tracking option in General settings page.
*
* @since 1.0.0
* @return void
*/
public function register_usage_tracking_setting() {

Expand All @@ -356,6 +366,7 @@ public function register_usage_tracking_setting() {
*
* @param bool $input Option value.
* @since 1.0.0
* @return string
*/
public function sanitize_option( $input ) {

Expand All @@ -370,6 +381,7 @@ public function sanitize_option( $input ) {
* Print settings field HTML.
*
* @since 1.0.0
* @return void
*/
public function render_settings_field_html() {
?>
Expand Down Expand Up @@ -399,7 +411,7 @@ public function render_settings_field_html() {
*/
private function get_product_name() {

$base = wp_normalize_path( dirname( __FILE__ ) );
$base = wp_normalize_path( __DIR__ );
$theme_dir = wp_normalize_path( get_template_directory() );

if ( false !== strpos( $base, $theme_dir ) ) {
Expand Down Expand Up @@ -441,7 +453,7 @@ private function get_plugin_name( $plugin_slug ) {
/**
* Set analytics installed time in option.
*
* @return string $time analytics installed time.
* @return string|mixed $time analytics installed time.
* @since 1.0.0
*/
private function get_analytics_install_time() {
Expand All @@ -463,6 +475,7 @@ private function get_analytics_install_time() {
* @param string $value value of option.
* @param string $option Option name.
* @since 1.0.0
* @return void
*/
public function update_analytics_option_callback( $old_value, $value, $option ) {
$this->add_option_to_network( $value );
Expand All @@ -474,6 +487,7 @@ public function update_analytics_option_callback( $old_value, $value, $option )
* @param string $option Option name.
* @param string $value value of option.
* @since 1.0.0
* @return void
*/
public function add_analytics_option_callback( $option, $value ) {
$this->add_option_to_network( $value );
Expand All @@ -483,6 +497,7 @@ public function add_analytics_option_callback( $option, $value ) {
* Schedule or unschedule event based on analytics option value.
*
* @since 1.0.0
* @return void
*/
public function schedule_unschedule_event() {

Expand All @@ -505,6 +520,7 @@ public function schedule_unschedule_event() {
*
* @param string $value value of option.
* @since 1.0.0
* @return void
*/
public function add_option_to_network( $value ) {

Expand Down
7 changes: 7 additions & 0 deletions assets/dynamic-css/uabb-theme-dynamic-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
*/

ob_start();

// Ensure $global_settings is defined and initialized.
if ( ! isset( $global_settings ) ) {
// Create an empty object to avoid undefined errors.
$global_settings = new stdClass();
}

?>

/* Theme Button
Expand Down
10 changes: 5 additions & 5 deletions bb-ultimate-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Ultimate Addons for Beaver Builder - Lite
* Plugin URI: http://www.ultimatebeaver.com/
* Description: Ultimate Addons is a free extension for Beaver Builder that adds 10 modules, and works on top of any Beaver Builder Package. (Free, Standard, Pro & Agency) You can use it with on any WordPress theme.
* Version: 1.5.11
* Version: 1.5.12
* Author: Brainstorm Force
* Author URI: http://www.brainstormforce.com
* Text Domain: uabb
Expand All @@ -18,7 +18,7 @@

define( 'BB_ULTIMATE_ADDON_DIR', plugin_dir_path( __FILE__ ) );
define( 'BB_ULTIMATE_ADDON_URL', plugins_url( '/', __FILE__ ) );
define( 'BB_ULTIMATE_ADDON_LITE_VERSION', '1.5.11' );
define( 'BB_ULTIMATE_ADDON_LITE_VERSION', '1.5.12' );
define( 'BSF_REMOVE_UABB_FROM_REGISTRATION_LISTING', true );
define( 'BB_ULTIMATE_ADDON_FILE', trailingslashit( dirname( __FILE__ ) ) . 'bb-ultimate-addon.php' );// @codingStandardsIgnoreLine.
define( 'BB_ULTIMATE_ADDON_LITE', true );
Expand All @@ -38,7 +38,7 @@ class BB_Ultimate_Addon {
*
* @since 1.0
*/
function __construct() {
public function __construct() {

register_activation_hook( __FILE__, array( $this, 'activation_reset' ) );

Expand All @@ -51,7 +51,7 @@ function __construct() {
*
* @Since 1.0
*/
function activation_reset() {
public function activation_reset() {

$no_memory = $this->check_memory_limit();

Expand All @@ -75,7 +75,7 @@ function activation_reset() {
*
* @Since 1.0
*/
function check_memory_limit() {
public function check_memory_limit() {

$memory_limit = ini_get( 'memory_limit' ); // Total Memory.
$peak_memory = memory_get_peak_usage( true ); // Available Memory.
Expand Down
9 changes: 5 additions & 4 deletions classes/class-uabb-admin-settings-multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class UABBBuilderMultisiteSettings {
* @since 1.0
* @return void
*/
static public function init() {
public static function init() {
add_action( 'admin_init', __CLASS__ . '::admin_init' );
add_action( 'admin_init', __CLASS__ . '::uabb_lite_redirect_on_activation' );
add_action( 'network_admin_menu', __CLASS__ . '::menu' );
Expand All @@ -30,8 +30,9 @@ static public function init() {
*
* @since 1.0
* @param string $url gets the activate redirect URL.
* @return void
*/
static public function uabb_lite_redirect_on_activation( $url ) {
public static function uabb_lite_redirect_on_activation( $url ) {
if ( true === get_option( 'uabb_lite_redirect' ) ) {
update_option( 'uabb_lite_redirect', false );
if ( ! is_multisite() ) :
Expand All @@ -47,7 +48,7 @@ static public function uabb_lite_redirect_on_activation( $url ) {
* @since 1.0
* @return void
*/
static public function admin_init() {
public static function admin_init() {
if ( is_network_admin() && isset( $_REQUEST['page'] ) && 'uabb-builder-multisite-settings' === $_REQUEST['page'] ) {
add_action( 'admin_enqueue_scripts', 'UABBBuilderAdminSettings::styles_scripts' );
UABBBuilderAdminSettings::save();
Expand All @@ -60,7 +61,7 @@ static public function admin_init() {
* @since 1.0
* @return void
*/
static public function menu() {
public static function menu() {
$title = UABB_PREFIX; // FLBuilderModel::get_branding();.
$cap = 'manage_network_plugins';
$slug = 'uabb-builder-multisite-settings';
Expand Down
Loading

0 comments on commit 9ac3057

Please sign in to comment.