Skip to content

Commit ae541ff

Browse files
committed
Version 2.3.3
1 parent a4e4c62 commit ae541ff

File tree

6 files changed

+91
-141
lines changed

6 files changed

+91
-141
lines changed

includes/add-embeds.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ function ce_quick_replace( $content = '', $options = '', $search = '' ) {
179179
function ce_generate_code( $html, $responsive = '', $max_width = '', $debug = '' ) {
180180

181181
$code = "\n";
182-
if ( 1 !== $debug ) {
183-
$code .= '<!-- Code Embed v' . CODE_EMBED_VERSION . " -->\n";
184-
}
185182

186183
if ( false !== $max_width ) {
187184
$code .= '<div style="width: ' . $max_width . 'px; max-width: 100%">';
@@ -202,9 +199,6 @@ function ce_generate_code( $html, $responsive = '', $max_width = '', $debug = ''
202199
}
203200

204201
$code .= "\n";
205-
if ( 1 !== $debug ) {
206-
$code .= '<!-- ' . __( 'End of Code Embed output', 'simple-embed-code' ) . " -->\n";
207-
}
208202

209203
return $code;
210204
}

includes/admin-config.php

Lines changed: 74 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<?php
22
/**
3-
* Administration Menu Options
4-
*
5-
* Add various adminstration menu options
6-
*
7-
* @package simple-embed-code
8-
*/
3+
* Administration Menu Options
4+
*
5+
* Add various adminstration menu options
6+
*
7+
* @package simple-embed-code
8+
*/
99

1010
/**
11-
* Add Settings link to plugin list
12-
*
13-
* Add a Settings link to the options listed against this plugin
14-
*
15-
* @since 1.6
16-
*
17-
* @param string $links Current links
18-
* @param string $file File in use
19-
* @return string Links, now with settings added
20-
*/
21-
11+
* Add Settings link to plugin list
12+
*
13+
* Add a Settings link to the options listed against this plugin
14+
*
15+
* @param string $links Current links.
16+
* @param string $file File in use.
17+
* @return string Links, now with settings added.
18+
*/
2219
function ce_add_settings_link( $links, $file ) {
2320

2421
static $this_plugin;
@@ -38,24 +35,25 @@ function ce_add_settings_link( $links, $file ) {
3835
add_filter( 'plugin_action_links', 'ce_add_settings_link', 10, 2 );
3936

4037
/**
41-
* Add meta to plugin details
42-
*
43-
* Add options to plugin meta line
44-
*
45-
* @since 1.6
46-
*
47-
* @param string $links Current links
48-
* @param string $file File in use
49-
* @return string Links, now with settings added
50-
*/
51-
38+
* Add meta to plugin details
39+
*
40+
* Add options to plugin meta line
41+
*
42+
* @param string $links Current links.
43+
* @param string $file File in use.
44+
* @return string Links, now with settings added.
45+
*/
5246
function ce_set_plugin_meta( $links, $file ) {
5347

5448
if ( false !== strpos( $file, 'code-embed.php' ) ) {
5549

5650
$links = array_merge( $links, array( '<a href="https://github.com/dartiss/code-embed">' . __( 'Github', 'simple-embed-code' ) . '</a>' ) );
5751

5852
$links = array_merge( $links, array( '<a href="https://wordpress.org/plugins/simple-embed-code/">' . __( 'Support', 'simple-embed-code' ) . '</a>' ) );
53+
54+
$links = array_merge( $links, array( '<a href="https://artiss.blog/donate">' . __( 'Donate', 'simple-embed-code' ) . '</a>' ) );
55+
56+
$links = array_merge( $links, array( '<a href="https://wordpress.org/support/plugin/simple-embed-code/reviews/#new-post">' . __( 'Write a Review', 'simple-embed-code' ) . '&nbsp;⭐️⭐️⭐️⭐️⭐️</a>' ) );
5957
}
6058

6159
return $links;
@@ -64,26 +62,23 @@ function ce_set_plugin_meta( $links, $file ) {
6462
add_filter( 'plugin_row_meta', 'ce_set_plugin_meta', 10, 2 );
6563

6664
/**
67-
* Code Embed Menu
68-
*
69-
* Add a new option to the Admin menu and context menu
70-
*
71-
* @since 1.4
72-
*
73-
* @uses ce_help Return help text
74-
*/
75-
65+
* Code Embed Menu
66+
*
67+
* Add a new option to the Admin menu and context menu
68+
*
69+
* @uses ce_help Return help text
70+
*/
7671
function ce_menu() {
7772

78-
// Add search sub-menu
73+
// Add search sub-menu.
7974

8075
global $ce_search_hook;
8176

8277
$ce_search_hook = add_submenu_page( 'tools.php', __( 'Code Embed Search', 'simple-embed-code' ), __( 'Code Search', 'simple-embed-code' ), 'edit_posts', 'ce-search', 'ce_search' );
8378

8479
add_action( 'load-' . $ce_search_hook, 'ce_add_search_help' );
8580

86-
// Add options sub-menu
81+
// Add options sub-menu.
8782

8883
global $ce_options_hook;
8984

@@ -96,15 +91,12 @@ function ce_menu() {
9691
add_action( 'admin_menu', 'ce_menu' );
9792

9893
/**
99-
* Add Options Help
100-
*
101-
* Add help tab to options screen
102-
*
103-
* @since 2.0
104-
*
105-
* @uses ce_options_help Return help text
106-
*/
107-
94+
* Add Options Help
95+
*
96+
* Add help tab to options screen
97+
*
98+
* @uses ce_options_help Return help text.
99+
*/
108100
function ce_add_options_help() {
109101

110102
global $ce_options_hook;
@@ -126,15 +118,12 @@ function ce_add_options_help() {
126118
}
127119

128120
/**
129-
* Add Search Help
130-
*
131-
* Add help tab to search screen
132-
*
133-
* @since 2.0
134-
*
135-
* @uses ce_search_help Return help text
136-
*/
137-
121+
* Add Search Help
122+
*
123+
* Add help tab to search screen
124+
*
125+
* @uses ce_search_help Return help text.
126+
*/
138127
function ce_add_search_help() {
139128

140129
global $ce_search_hook;
@@ -156,43 +145,34 @@ function ce_add_search_help() {
156145
}
157146

158147
/**
159-
* Code Embed Options
160-
*
161-
* Define an option screen
162-
*
163-
* @since 1.4
164-
*/
165-
148+
* Code Embed Options
149+
*
150+
* Define an option screen
151+
*/
166152
function ce_options() {
167153

168-
include_once( WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'options-screen.php' );
154+
include_once WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'options-screen.php';
169155

170156
}
171157

172158
/**
173-
* Code Embed Search
174-
*
175-
* Define a the search screen
176-
*
177-
* @since 1.6
178-
*/
179-
159+
* Code Embed Search
160+
*
161+
* Define a the search screen
162+
*/
180163
function ce_search() {
181164

182-
include_once( WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'search-screen.php' );
165+
include_once WP_PLUGIN_DIR . '/' . str_replace( basename( __FILE__ ), '', plugin_basename( __FILE__ ) ) . 'search-screen.php';
183166

184167
}
185168

186169
/**
187-
* Code Embed Options Help
188-
*
189-
* Return help text for options screen
190-
*
191-
* @since 1.5
192-
*
193-
* @return string Help Text
194-
*/
195-
170+
* Code Embed Options Help
171+
*
172+
* Return help text for options screen
173+
*
174+
* @return string Help Text.
175+
*/
196176
function ce_options_help() {
197177

198178
$help_text = '<p>' . __( 'Use this screen to modify the various settings, including the identifiers and keyword used to specify your embedded code.', 'simple-embed-code' ) . '</p>';
@@ -205,15 +185,12 @@ function ce_options_help() {
205185
}
206186

207187
/**
208-
* Code Embed Search Help
209-
*
210-
* Return help text for search screen
211-
*
212-
* @since 1.6
213-
*
214-
* @return string Help Text
215-
*/
216-
188+
* Code Embed Search Help
189+
*
190+
* Return help text for search screen
191+
*
192+
* @return string Help Text
193+
*/
217194
function ce_search_help() {
218195

219196
$help_text = '<p>' . __( 'This screen allows you to search for the post and pages that a particular code embed has been used in.', 'simple-embed-code' ) . '</p>';
@@ -224,15 +201,12 @@ function ce_search_help() {
224201
}
225202

226203
/**
227-
* Code Embed Help Sidebar
228-
*
229-
* Return sidebar help text
230-
*
231-
* @since 2.3
232-
*
233-
* @return string Help Text
234-
*/
235-
204+
* Code Embed Help Sidebar
205+
*
206+
* Return sidebar help text
207+
*
208+
* @return string Help Text.
209+
*/
236210
function ce_help_sidebar() {
237211

238212
$help_text = '<p><strong>' . __( 'For more information:', 'simple-embed-code' ) . '</strong></p>';

includes/initialise.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ function ce_initialisation() {
3939
'opening_ident' => '{{',
4040
'keyword_ident' => 'CODE',
4141
'closing_ident' => '}}',
42-
'debug' => '',
4342
'excerpts' => '',
4443
);
4544

includes/options-screen.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@
3838
$options['closing_ident'] = '}}';
3939
}
4040

41-
if ( ! empty( $_POST['code_embed_debug'] ) ) {
42-
$options['debug'] = sanitize_text_field( wp_unslash( $_POST['code_embed_debug'] ) ); // Input var okay.
43-
} else {
44-
$options['debug'] = '';
45-
}
46-
4741
if ( isset( $_POST['code_embed_excerpt'] ) ) {
4842
$options['excerpt'] = sanitize_text_field( wp_unslash( $_POST['code_embed_excerpt'] ) ); // Input var okay.
4943
} else {
@@ -63,13 +57,6 @@
6357
<form method="post" action="<?php echo esc_html( get_bloginfo( 'wpurl' ) ) . '/wp-admin/options-general.php?page=ce-options'; ?>">
6458

6559
<table class="form-table">
66-
<tr>
67-
<th scope="row"><label for="code_embed_debug"><?php echo esc_html( ucwords( __( 'Hide debug', 'simple-embed-code' ) ) ); ?></label></th>
68-
<td><input type="checkbox" name="code_embed_debug" value="1"
69-
<?php checked( '1', $options['debug'] ); ?>
70-
/><?php esc_html_e( 'Hide debug HTML comments in source', 'simple-embed-code' ); ?></td>
71-
</tr>
72-
7360
<tr>
7461
<th scope="row"><label for="code_embed_excerpt"><?php echo esc_html( ucwords( __( 'Allow in excerpts', 'simple-embed-code' ) ) ); ?></label></th>
7562
<td><input type="checkbox" name="code_embed_excerpt" value="1"

readme.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Contributors: dartiss
33
Donate link: https://artiss.blog/donate
44
Tags: code, embed, html, javascript, script
55
Requires at least: 4.6
6-
Tested up to: 5.3
6+
Tested up to: 5.4
77
Requires PHP: 5.3
8-
Stable tag: 2.3.2
8+
Stable tag: 2.3.3
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -185,6 +185,9 @@ It is, in that it doesn't save any data that could be odds with GDPR compliance
185185

186186
[Learn more about my version numbering methodology](https://artiss.blog/2016/09/wordpress-plugin-versioning/ "WordPress Plugin Versioning")
187187

188+
= 2.3.3 =
189+
* Enhancement: I've removed the debug code. I allowed to be switched off but I've never used it and it may not have switched off properly anyway. So it's gone.
190+
188191
= 2.3.2 =
189192
* Bug: Fixed another pesky bug that was affecting embedded URLs. My code to do this was years old and I couldn't understand why I'd written it the way I had. So I've re-written it from scratch.
190193

@@ -294,5 +297,5 @@ versions of this plugin
294297

295298
== Upgrade Notice ==
296299

297-
= 2.3.2 =
298-
* Minor bug fix
300+
= 2.3.3 =
301+
* Minor change to code output

simple-code-embed.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
11
<?php
2-
/*
2+
/**
33
Plugin Name: Code Embed
44
Plugin URI: https://github.com/dartiss/code-embed
55
Description: Code Embed provides a very easy and efficient way to embed code (JavaScript and HTML) in your posts and pages.
6-
Version: 2.3.2
6+
Version: 2.3.3
77
Author: David Artiss
88
Author URI: https://artiss.blog
99
Text Domain: simple-embed-code
10-
*/
1110
12-
/**
13-
* Code Embed
14-
*
15-
* Embed code into a post
16-
*
17-
* @package Code-Embed
18-
* @since 1.6
19-
*/
11+
@package Code-Embed
12+
*/
2013

21-
define( 'CODE_EMBED_VERSION', '2.3.2' );
14+
define( 'CODE_EMBED_VERSION', '2.3.3' );
2215

23-
// Include all the various functions
16+
// Include all the various functions.
2417

2518
$functions_dir = plugin_dir_path( __FILE__ ) . 'includes/';
2619

27-
include_once( $functions_dir . 'initialise.php' ); // Initialisation scripts
20+
require_once $functions_dir . 'initialise.php'; // Initialisation scripts.
2821

2922
if ( is_admin() ) {
3023

31-
include_once( $functions_dir . 'admin-config.php' ); // Various administration config. options
24+
require_once $functions_dir . 'admin-config.php'; // Various administration config. options.
3225

3326
} else {
3427

35-
include_once( $functions_dir . 'add-scripts.php' ); // Add scripts to the main theme
28+
require_once $functions_dir . 'add-scripts.php'; // Add scripts to the main theme.
3629

37-
include_once( $functions_dir . 'add-embeds.php' ); // Filter to apply code embeds
30+
require_once $functions_dir . 'add-embeds.php'; // Filter to apply code embeds.
3831

3932
}

0 commit comments

Comments
 (0)