Skip to content

Commit

Permalink
Merge pull request #18 from Slobork/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Slobork authored Nov 12, 2023
2 parents bb9d9ff + f1d17da commit fa70f60
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 31 deletions.
6 changes: 2 additions & 4 deletions admin/admin-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@
// phpcs:ignore
function booster_sweeper_admin_scripts()
{

$plugin_version = Booster_Sweeper::version();
$current_screen = get_current_screen()->base;

// Load only on Booster Sweeper settings page.
if ($current_screen === 'toplevel_page_booster-sweeper-settings') {

wp_enqueue_style('booster-sweeper-adminizr', plugin_dir_url(__DIR__) .'library/admin/adminizr.css', array(), $plugin_version);
wp_enqueue_script('booster-sweeper-adminizr', plugin_dir_url(__DIR__) .'library/admin/adminizr.js', array( 'jquery' ), $plugin_version, true);
wp_enqueue_style('booster-sweeper-adminizr', plugin_dir_url(__DIR__) .'library/admin/adminizr.css', array(), BOOSTER_SWEEPER_VERSION);
wp_enqueue_script('booster-sweeper-adminizr', plugin_dir_url(__DIR__) .'library/admin/adminizr.js', array( 'jquery' ), BOOSTER_SWEEPER_VERSION, true);

// add local vars for translation, accesed through the JS
$local_var_array = array(
Expand Down
5 changes: 3 additions & 2 deletions admin/opt/config/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
* Set a unique slug-like ID.
*/
$prefix = '_booster_sweeper_options';

$BS_pro_version = defined('BOOSTER_SWEEPER_PRO_VERSION') ? BOOSTER_SWEEPER_PRO_VERSION : '';
$print_pro_version = $BS_pro_version !== '' ? ' - Pro Version: ' .BOOSTER_SWEEPER_PRO_VERSION : '';

CSF::createOptions(
$prefix, array(
Expand All @@ -25,7 +26,7 @@
'menu_slug' => 'booster-sweeper-settings',
'menu_icon' => 'dashicons-image-filter',

'footer_credit' => 'Booster Sweeper <small> v1.0.4</small>',
'footer_credit' => 'Booster Sweeper <small> ' .BOOSTER_SWEEPER_VERSION .$print_pro_version .'</small>',
'footer_text' => ' ',
'theme' => 'light',
'show_bar_menu' => false,
Expand Down
22 changes: 15 additions & 7 deletions booster-sweeper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@
*
* Author: MaxPressy
* Author URI: https://maxpressy.com
* Version: 1.0.4
* Version: 1.0.5
* Text Domain: booster_sweeper
* Domain Path: /languages
* Requires at least: 6.0
*/

if (! defined('ABSPATH')) {
exit;
if (! defined('ABSPATH')) {
exit;
}

require_once 'classes/init.php';
require_once 'classes/resources.php';
require_once 'clean-html.php';
require_once 'admin/admin-init.php';
// Plugin data (getting plugin version, name, etc.)
if (! function_exists('get_plugin_data')) {
include_once ABSPATH .'wp-admin/includes/plugin.php';
}
$plugin_data = get_plugin_data(__FILE__);
define('BOOSTER_SWEEPER', ($plugin_data && $plugin_data['Name']) ? $plugin_data['Name'] : 'Booster Sweeper');
define('BOOSTER_SWEEPER_VERSION', ($plugin_data && $plugin_data['Version']) ? $plugin_data['Version'] : '1.0.0');

require_once 'classes/init.php';
require_once 'classes/resources.php';
require_once 'clean-html.php';
require_once 'admin/admin-init.php';
16 changes: 0 additions & 16 deletions classes/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@
class Booster_Sweeper
{

/**
* Version.
*
* Also has to be updated in the framework settings' createOptions,
*
* @see /admin/opt/config/framework.php
*/
// phpcs:ignore
public static function version()
{

$plugin_version = '1.0.4';
return $plugin_version;

}

/**
* Load plugin's textdomain.
*
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Contributors: MaxPressy
Tags: speed, performance, pagespeed, dequeue, seo, assets
Tested up to: 6.3
Stable tag: 1.0.4
Tested up to: 6.4
Stable tag: 1.0.5
Requires at least: 6.0
Requires PHP: 7.3.5
License: GPLv2 or later
Expand Down Expand Up @@ -66,6 +66,9 @@ After activating the plugin, in your WordPress Dashboard find the section "Boost


== Changelog ==
= 1.0.5 - 2022-11-13 =
* Change the way the plugin version is retrieved and printed

= 1.0.4 - 2022-08-13 =
* Update Fields framework
* Compatibility with WP 6.3
Expand Down

0 comments on commit fa70f60

Please sign in to comment.