Skip to content

Commit 8acabeb

Browse files
authored
Merge pull request #65 from dartiss/develop
Develop
2 parents 6eabfe1 + 5a39128 commit 8acabeb

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

includes/add-embeds.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ function ce_filter( $content ) {
6262

6363
if ( strlen( $suffix ) - 4 === $res_pos ) {
6464
$responsive = true;
65-
} else {
66-
if ( '_' === substr( $suffix, $res_pos + 4, 1 ) ) {
67-
$responsive = true;
68-
$max_width = substr( $suffix, $res_pos + 5 );
69-
if ( ! is_numeric( $max_width ) ) {
70-
$max_width = '';
71-
}
65+
} elseif ( '_' === substr( $suffix, $res_pos + 4, 1 ) ) {
66+
$responsive = true;
67+
$max_width = substr( $suffix, $res_pos + 5 );
68+
if ( ! is_numeric( $max_width ) ) {
69+
$max_width = '';
7270
}
7371
}
7472

@@ -140,7 +138,7 @@ function ce_quick_replace( $content = '', $options = '', $search = '' ) {
140138
$end_pos = strpos( $content, $options['closing_ident'], $start_pos + 1 );
141139

142140
if ( false !== $end_pos ) {
143-
$url = substr( $content, $start_pos + 1, $end_pos - $start_pos - 1 );
141+
$url = substr( $content, $start_pos + 2, $end_pos - $start_pos - 2 );
144142
$file = ce_get_file( $url );
145143
if ( false !== $file ) {
146144
$content = str_replace( $options['opening_ident'] . $url . $options['closing_ident'], $file, $content );
@@ -284,18 +282,17 @@ function ce_get_file( $filein ) {
284282
*
285283
* @param string $error Error message.
286284
* @param string $plugin_name The name of the plugin.
287-
* @param string $echo True or false, depending on whether you wish to return or echo the results.
285+
* @param string $echo_out True or false, depending on whether you wish to return or echo the results.
288286
* @return string True or the output text
289287
*/
290-
function ce_report_error( $error, $plugin_name, $echo = true ) {
288+
function ce_report_error( $error, $plugin_name, $echo_out = true ) {
291289

292290
$output = '<p style="color: #f00; font-weight: bold;">' . $plugin_name . ': ' . $error . "</p>\n";
293291

294-
if ( $echo ) {
292+
if ( $echo_out ) {
295293
echo esc_html( $output );
296294
return true;
297295
} else {
298296
return $output;
299297
}
300-
301298
}

includes/add-scripts.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
*/
1515
function ce_main_scripts() {
1616

17-
wp_register_style( 'ce_responsive', plugins_url( 'css/video-container.min.css', dirname( __FILE__ ) ), array(), CODE_EMBED_VERSION );
17+
wp_register_style( 'ce_responsive', plugins_url( 'css/video-container.min.css', __DIR__ ), array(), CODE_EMBED_VERSION );
1818

1919
wp_enqueue_style( 'ce_responsive' );
20-
2120
}
2221

2322
add_action( 'wp_enqueue_scripts', 'ce_main_scripts' );

includes/admin-config.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ function ce_menu() {
8585
$ce_options_hook = add_submenu_page( 'options-general.php', __( 'Code Embed Settings', 'simple-embed-code' ), __( 'Code Embed', 'simple-embed-code' ), 'manage_options', 'ce-options', 'ce_options' );
8686

8787
add_action( 'load-' . $ce_options_hook, 'ce_add_options_help' );
88-
8988
}
9089

9190
add_action( 'admin_menu', 'ce_menu' );
@@ -152,7 +151,6 @@ function ce_add_search_help() {
152151
function ce_options() {
153152

154153
include_once WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'options-screen.php';
155-
156154
}
157155

158156
/**
@@ -163,7 +161,6 @@ function ce_options() {
163161
function ce_search() {
164162

165163
include_once WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'search-screen.php';
166-
167164
}
168165

169166
/**

includes/initialise.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
*
77
* @package simple-embed-code
88
*/
9+
10+
/**
11+
* Initialisation
12+
*
13+
* All initial processes.
14+
*/
915
function ce_initialisation() {
1016

1117
// Add exerpt filter, if required.

readme.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: code, embed, html, css, javascript, script
55
Requires at least: 4.6
66
Tested up to: 6.4
77
Requires PHP: 7.4
8-
Stable tag: 2.3.6
8+
Stable tag: 2.3.7
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -195,6 +195,10 @@ It is, in that it doesn't save any data that could be odds with GDPR compliance
195195

196196
I use semantic versioning, with the first release being 1.0.
197197

198+
= 2.3.7 =
199+
* Bug: Fixed a bug which created a potentual vulnerabilty
200+
* Enhancement: Improved code quality, using the latest version of PHPCS and WordPress sniffs
201+
198202
= 2.3.6 =
199203
* Bug: Fixed a variable that was incorrectly assigned. It happens. I guess.
200204

@@ -320,5 +324,5 @@ versions of this plugin
320324

321325
== Upgrade Notice ==
322326

323-
= 2.3.6 =
324-
* Minor bug fix
327+
= 2.3.7 =
328+
* Important vulnerability fix

simple-code-embed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin Name: Code Embed
1010
* Plugin URI: https://wordpress.org/plugins/simple-embed-code/
1111
* Description: 🧩 Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.
12-
* Version: 2.3.6
12+
* Version: 2.3.7
1313
* Requires at least: 4.6
1414
* Requires PHP: 7.4
1515
* Author: David Artiss
@@ -26,7 +26,7 @@
2626
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2727
*/
2828

29-
define( 'CODE_EMBED_VERSION', '2.3.6' );
29+
define( 'CODE_EMBED_VERSION', '2.3.7' );
3030

3131
// Include all the various functions.
3232

0 commit comments

Comments
 (0)