Skip to content
This repository was archived by the owner on Dec 4, 2019. It is now read-only.

Commit d6c6d9b

Browse files
committed
Bugfix 1.5.1
1 parent 92dbd17 commit d6c6d9b

File tree

17 files changed

+74
-31
lines changed

17 files changed

+74
-31
lines changed

WPlusPlusCore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Plugin Name: W++ Core
2020
* Plugin URI: https://github.com/tofandel/wplusplus-core/
2121
* Description: A Wordpress Plugin acting as core for other of my plugins and including the Ultimate Redux Framework Bundle and OOP APIs to use it
22-
* Version: 1.5
22+
* Version: 1.5.1
2323
* Author: Adrien Foulon <tofandel@tukan.hu>
2424
* Author URI: https://tukan.fr/a-propos/#adrien-foulon
2525
* Text Domain: wplusplus-core

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tofandel/wplusplus-core",
3-
"version": "1.2.7",
3+
"version": "1.5.1",
44
"authors": [
55
{
66
"name": "Tofandel"

functions.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,34 @@ function wpp_admin_notice( $text, $type = 'success' ) {
1010
} );
1111
}
1212

13+
/**
14+
* @param WP_Post $post
15+
* @param string|array $shortcode
16+
*
17+
* @return bool
18+
*/
19+
function wpp_has_shortcode( $post, $shortcode ) {
20+
if ( is_array( $shortcode ) ) {
21+
foreach ( $shortcode as $sh ) {
22+
if ( has_shortcode( $post->post_content, $sh ) ) {
23+
return true;
24+
}
25+
if ( has_shortcode( $post->post_content, strtolower( $sh ) ) ) {
26+
return true;
27+
}
28+
}
29+
} else {
30+
if ( has_shortcode( $post->post_content, $shortcode ) ) {
31+
return true;
32+
}
33+
if ( has_shortcode( $post->post_content, strtolower( $shortcode ) ) ) {
34+
return true;
35+
}
36+
}
37+
38+
return false;
39+
}
40+
1341
/**
1442
* @param string $string The string to slugifiy
1543
* @param bool $prepend Can be (and should) be used as a vendor name to separate slugs

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "W++ Core",
3-
"version": "1.5",
3+
"version": "1.5.1",
44
"download_url": "https://github.com/Tofandel/wplusplus-core",
55
"homepage": "https://tukangroup.com/about-us/#adrien-foulon",
66
"requires": "4.6",

plugins/redux-extensions/action_button/action_button/field_action_button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function enqueue() {
118118
wp_enqueue_script(
119119
'redux-field-action-button-js',
120120
apply_filters( "redux/action_button/{$this->parent->args['opt_name']}/enqueue/redux-field-action-button-js", $this->extension_url . 'field_action_button' . $min . '.js' ),
121-
array( 'jquery' ),
121+
array( 'jquery', 'redux-js' ),
122122
time(),
123123
true
124124
);

plugins/redux-extensions/js_button/js_button/field_js_button.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public function render() {
101101
* @return void
102102
*/
103103
public function enqueue() {
104-
$extension = ReduxFramework_extension_js_button::getInstance();
105104

106105
// Make sure script data exists first
107106
if ( isset( $this->field['script'] ) && ! empty( $this->field['script'] ) ) {
@@ -145,7 +144,7 @@ public function enqueue() {
145144
wp_enqueue_script(
146145
'redux-field-js-button-js',
147146
apply_filters( "redux/js_button/{$this->parent->args['opt_name']}/enqueue/redux-field-js-button-js", $this->extension_url . 'field_js_button' . $min . '.js' ),
148-
array( 'jquery' ),
147+
array( 'jquery', 'redux-js' ),
149148
time(),
150149
true
151150
);

plugins/redux-extensions/repeater/repeater/field_repeater.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ public function render() {
276276
*/
277277
public function enqueue() {
278278

279-
$extension = ReduxFramework_extension_repeater::getInstance();
280-
281279
// Set up min files for dev_mode = false.
282280
$min = Redux_Functions::isMin();
283281

plugins/redux-framework/ReduxCore/assets/css/redux-admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/redux-framework/ReduxCore/assets/css/redux-admin.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ pre {
12931293
}
12941294

12951295
@media screen and (max-width: 640px) {
1296-
#redux-defaults-section {
1296+
#redux-defaults-section-header, #redux-defaults-section-footer {
12971297
display: none;
12981298
}
12991299
}
@@ -1305,9 +1305,6 @@ pre {
13051305
}
13061306

13071307
@media screen and (max-width: 730px) {
1308-
#redux-defaults-section2 {
1309-
display: none;
1310-
}
13111308
#redux-share {
13121309
display: none;
13131310
}

plugins/redux-framework/ReduxCore/inc/validation/preg_replace/validation_preg_replace.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ function __construct( $parent, $field, $value, $current ) {
2626
* @since ReduxFramework 1.0.0
2727
*/
2828
function validate() {
29-
$this->value = preg_replace_callback( $this->field['preg']['pattern'], function ( $matches ) {
30-
return $this->field['preg']['replacement'];
31-
}, $this->value );
29+
$this->value = preg_replace( $this->field['preg']['pattern'], $this->field['preg']['replacement'], $this->value );
3230
} //function
3331
} //class
3432
}

plugins/redux-framework/ReduxCore/templates/panel/footer.tpl.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@
5555
<span class="spinner"></span>
5656
<?php
5757
if ( false === $this->parent->args['hide_save'] ) {
58-
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false );
58+
submit_button( __( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false, array( 'id' => 'redux-save-footer' ) );
5959
}
6060

61-
if ( false === $this->parent->args['hide_reset'] ) {
62-
submit_button( __( 'Reset Section', 'redux-framework' ), 'secondary', $this->parent->args['opt_name'] . '[defaults-section]', false, array( 'id' => 'redux-defaults-section' ) );
63-
submit_button( __( 'Reset All', 'redux-framework' ), 'secondary', $this->parent->args['opt_name'] . '[defaults]', false, array( 'id' => 'redux-defaults' ) );
61+
if ( false === $this->parent->args['hide_reset'] ) { ?>
62+
<?php submit_button( esc_attr__( 'Reset Section', 'redux-framework' ), 'secondary',
63+
$this->parent->args['opt_name'] . '[defaults-section]', false, array( 'id' => 'redux-defaults-section-footer' ) ); ?>
64+
<?php submit_button( esc_attr__( 'Reset All', 'redux-framework' ), 'secondary',
65+
$this->parent->args['opt_name'] . '[defaults]', false, array( 'id' => 'redux-defaults-footer' ) ); ?>
66+
<?php
6467
}
6568
?>
6669
</div>

plugins/redux-framework/ReduxCore/templates/panel/header_stickybar.tpl.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ class="expand_options<?php echo esc_attr( ( $this->parent->args['open_expanded']
1919
<div class="redux-action_bar">
2020
<span class="spinner"></span>
2121
<?php if ( false === $this->parent->args['hide_save'] ) { ?>
22-
<?php submit_button( esc_attr__( 'Save Changes', 'redux-framework' ), 'primary', 'redux_save', false ); ?>
22+
<?php submit_button( esc_attr__( 'Save Changes', 'redux-framework' ), 'primary',
23+
'redux_save', false, array( 'id' => 'redux-save-header' ) ); ?>
2324
<?php } ?>
2425

2526
<?php if ( false === $this->parent->args['hide_reset'] ) { ?>
26-
<?php submit_button( esc_attr__( 'Reset Section', 'redux-framework' ), 'secondary', $this->parent->args['opt_name'] . '[defaults-section]', false, array( 'id' => 'redux-defaults-section' ) ); ?>
27-
<?php submit_button( esc_attr__( 'Reset All', 'redux-framework' ), 'secondary', $this->parent->args['opt_name'] . '[defaults]', false, array( 'id' => 'redux-defaults' ) ); ?>
27+
<?php submit_button( esc_attr__( 'Reset Section', 'redux-framework' ), 'secondary',
28+
$this->parent->args['opt_name'] . '[defaults-section]', false, array( 'id' => 'redux-defaults-section-header' ) ); ?>
29+
<?php submit_button( esc_attr__( 'Reset All', 'redux-framework' ), 'secondary',
30+
$this->parent->args['opt_name'] . '[defaults]', false, array( 'id' => 'redux-defaults-header' ) ); ?>
2831
<?php } ?>
2932
</div>
3033
<div class="redux-ajax-loading" alt="<?php esc_attr_e( 'Working...', 'redux-framework' ) ?>">&nbsp;</div>

plugins/zips/redux-framework.zip

-112 Bytes
Binary file not shown.

src/Modules/LicenceManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private function _checkLicence() {
179179
}
180180

181181
$data = $this->doRequest( 'status' );
182-
if ( $data['status_check'] == 'active' ) {
182+
if ( ! empty( $data['status_check'] ) && $data['status_check'] == 'active' ) {
183183
$this->setMessage( $data['activations_remaining'] );
184184
$this->setActivated();
185185
$this->setLicenceTransient();

src/Modules/VC_Integration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public function integrateToVC() {
3232
vc_add_shortcode_param( 'hidden', '__return_false' );
3333
}
3434

35-
public function createVCPro() {
36-
return '<strong>' . sprintf( esc_html( __( 'This is a pro feature, %sgo pro now !%s', $this->getTextDomain() ) ), '<a href="' . $this->parent->getBuyUrl() . '" target="_blank" rel="noopener">', '</a>' ) . '</strong>';
35+
36+
public function createVCPro( $settings ) {
37+
return '<strong>' . sprintf( esc_html( __( 'This is a pro feature, %sgo pro now !%s', $this->getTextDomain() ) ), '<a href="' . $settings['buy_url'] . '" target="_blank" rel="noopener">', '</a>' ) . '</strong>';
3738
}
3839

3940
/**

src/Traits/WP_Shortcode.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function __init__() {
2626
return;
2727
}
2828

29-
static::$_name = static::$reflectionClass->getShortName();
29+
static::getName();
3030

3131
new \Tofandel\Core\Objects\WP_Shortcode( static::$_name, [ static::class, 'shortcode' ], static::$atts );
3232
}
@@ -41,10 +41,26 @@ public static function __init__() {
4141
//abstract public function shortcode( $attributes, $content, $name );
4242

4343
/**
44-
* @return mixed
44+
* @throws \ReflectionException
4545
*/
46-
public function getName() {
47-
return static::$_name;
46+
public static function getName() {
47+
if ( ! empty( static::$_name ) ) {
48+
return static::$_name;
49+
}
50+
if ( ! isset( static::$reflectionClass ) ) {
51+
static::$reflectionClass = new \ReflectionClass( static::class );
52+
}
53+
54+
return static::$_name = static::$reflectionClass->getShortName();
55+
}
56+
57+
/**
58+
* @return array
59+
*/
60+
public static function getNames() {
61+
$name = static::getName();
62+
63+
return array( $name, strtolower( $name ) );
4864
}
4965

5066
}

src/Traits/WP_VC_Shortcode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function __init__() {
6363
return;
6464
}
6565

66-
static::$_name = static::$reflectionClass->getShortName();
66+
static::getName();
6767

6868
static::$vc_params = array_merge( array(
6969
'base' => static::$_name

0 commit comments

Comments
 (0)