PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 1.3
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v1.3
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
← All changes | insert_php.php +60 -100 2.0.61.3 View file →
@@ -1,100 +1,60 @@
1 -<?php
2 - /**
3 - * Plugin Name: PHP code snippets (Insert PHP)
4 - * Plugin URI: https://wordpress.org/plugins/insert-php/
5 - * Description: Run PHP code inserted into WordPress posts and pages. An easy, clean and easy way to add code snippets to your site. You do not need to edit the functions.php file of your theme again!
6 - * Author: Will Bontrager Software, LLC <will@willmaster.com>, Webcraftic <wordpress.webraftic@gmail.com>
7 - * Version: 2.0.6
8 - * Text Domain: insert-php
9 - * Domain Path: /languages/
10 - * Author URI: http://www.willmaster.com/contact.php
11 - */
12 -
13 - // Exit if accessed directly
14 - if( !defined('ABSPATH') ) {
15 - exit;
16 - }
17 -
18 - if( defined('WINP_PLUGIN_ACTIVE') ) {
19 - return;
20 - }
21 -
22 - // Set the constant that the plugin is activated
23 - define('WINP_PLUGIN_ACTIVE', true);
24 -
25 - // Root directory of the plugin
26 - define('WINP_PLUGIN_DIR', dirname(__FILE__));
27 -
28 - // Absolute url of the root directory of the plugin
29 - define('WINP_PLUGIN_URL', plugins_url(null, __FILE__));
30 -
31 - // Relative url of the plugin
32 - define('WINP_PLUGIN_BASE', plugin_basename(__FILE__));
33 -
34 - // The type of posts used for snippets types
35 - define('WINP_SNIPPETS_POST_TYPE', 'wbcr-snippets');
36 -
37 - // The taxonomy used for snippets types
38 - define('WINP_SNIPPETS_TAXONOMY', 'wbcr-snippet-tags');
39 -
40 -
41 -
42 - global $wp_version;
43 -
44 - // Troubleshoot old versions of WordPress
45 - if( version_compare($wp_version, '4.2.0', '>') ) {
46 -
47 - require_once(WINP_PLUGIN_DIR . '/libs/factory/core/boot.php');
48 -
49 - require_once(WINP_PLUGIN_DIR . '/includes/class.helpers.php');
50 - require_once(WINP_PLUGIN_DIR . '/includes/class.plugin.php');
51 -
52 - new WINP_Plugin(__FILE__, array(
53 - 'prefix' => 'wbcr_inp_',
54 - 'plugin_name' => 'wbcr_insert_php',
55 - 'plugin_title' => __('PHP code snippets (Insert PHP)', 'insert-php'),
56 - 'plugin_version' => '2.0.6',
57 - 'required_php_version' => '5.2',
58 - 'required_wp_version' => '4.2',
59 - 'plugin_build' => 'free',
60 - //'updates' => WINP_PLUGIN_DIR . '/updates/'
61 - ));
62 - } else {
63 - // Notification about the old version of Wordpress
64 - add_action('admin_notices', function () {
65 - echo '<div class="notice notice-error"><p>' . __('You are using the old version of Wordpress, for the <b>PHP code snippets (Insert PHP)</b> plugin you need Wordpress 4.2 and higher versions!', 'insert-php') . '</p></div>';
66 - });
67 - }
68 -
69 - /*
70 - Note: This plugin requires WordPress version 3.3.1 or higher.
71 -
72 - Information about the Insert PHP plugin can be found here:
73 - http://www.willmaster.com/software/WPplugins/go/iphphome_iphplugin
74 -
75 - Instructions and examples can be found here:
76 - http://www.willmaster.com/software/WPplugins/go/iphpinstructions_iphplugin
77 - */
78 -
79 - // todo: This is the code of the old version of the plugin, left unchanged for compatibility. Delete in the new major version of the plugin
80 - if( !function_exists('will_bontrager_insert_php') ) {
81 -
82 - function will_bontrager_insert_php($content)
83 - {
84 - $will_bontrager_content = $content;
85 - preg_match_all('!\[insert_php[^\]]*\](.*?)\[/insert_php[^\]]*\]!is', $will_bontrager_content, $will_bontrager_matches);
86 - $will_bontrager_nummatches = count($will_bontrager_matches[0]);
87 - for($will_bontrager_i = 0; $will_bontrager_i < $will_bontrager_nummatches; $will_bontrager_i++) {
88 - ob_start();
89 - eval($will_bontrager_matches[1][$will_bontrager_i]);
90 - $will_bontrager_replacement = ob_get_contents();
91 - ob_clean();
92 - ob_end_flush();
93 - $will_bontrager_content = preg_replace('/' . preg_quote($will_bontrager_matches[0][$will_bontrager_i], '/') . '/', $will_bontrager_replacement, $will_bontrager_content, 1);
94 - }
95 -
96 - return $will_bontrager_content;
97 - } # function will_bontrager_insert_php()
98 -
99 - add_filter('the_content', 'will_bontrager_insert_php', 9);
100 - } # if( ! function_exists('will_bontrager_insert_php') )
1 +<?php
2 +/*
3 +Plugin Name: Insert PHP
4 +Plugin URI: http://www.willmaster.com/software/WPplugins/
5 +Description: Run PHP code inserted into WordPress posts and pages.
6 +Version: 1.3
7 +Date: 29 September 2015
8 +Author: Will Bontrager Software, LLC <will@willmaster.com>
9 +Author URI: http://www.willmaster.com/contact.php
10 +*/
11 +
12 +/*
13 + Copyright 2012,2013,2015 Will Bontrager Software LLC (email: will@willmaster.com)
14 +
15 + This program is free software; you can redistribute it and/or modify
16 + it under the terms of the GNU General Public License, version 2, as
17 + published by the Free Software Foundation. A copy of the license is at
18 + http://www.gnu.org/licenses/gpl-2.0.html
19 +
20 + This program is distributed in the hope that it will be useful,
21 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 + GNU General Public License for more details.
24 +*/
25 +
26 +/*
27 +Note: This plugin requires WordPress version 3.3.1 or higher.
28 +
29 +Information about the Insert PHP plugin can be found here:
30 +http://www.willmaster.com/software/WPplugins/go/iphphome_iphplugin
31 +
32 +Instructions and examples can be found here:
33 +http://www.willmaster.com/software/WPplugins/go/iphpinstructions_iphplugin
34 +*/
35 +
36 +
37 +if( ! function_exists('will_bontrager_insert_php') )
38 +{
39 +
40 + function will_bontrager_insert_php($content)
41 + {
42 + $will_bontrager_content = $content;
43 + preg_match_all('!\[insert_php[^\]]*\](.*?)\[/insert_php[^\]]*\]!is',$will_bontrager_content,$will_bontrager_matches);
44 + $will_bontrager_nummatches = count($will_bontrager_matches[0]);
45 + for( $will_bontrager_i=0; $will_bontrager_i<$will_bontrager_nummatches; $will_bontrager_i++ )
46 + {
47 + ob_start();
48 + eval($will_bontrager_matches[1][$will_bontrager_i]);
49 + $will_bontrager_replacement = ob_get_contents();
50 + ob_clean();
51 + ob_end_flush();
52 + $will_bontrager_content = preg_replace('/'.preg_quote($will_bontrager_matches[0][$will_bontrager_i],'/').'/',$will_bontrager_replacement,$will_bontrager_content,1);
53 + }
54 + return $will_bontrager_content;
55 + } # function will_bontrager_insert_php()
56 +
57 + add_filter( 'the_content', 'will_bontrager_insert_php', 9 );
58 +
59 +} # if( ! function_exists('will_bontrager_insert_php') )
60 +?>