PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.3.1
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.3.1
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 2.7.1 All 27 releases
insert-php / insert_php.php

insert_php.php in Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts 2.3.1, at insert_php.php

238 lines 9.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Woody ad snippets (PHP snippets | Insert PHP)
4 * Plugin URI: http://woody-ad-snippets.webcraftic.com/
5 * Description: Executes PHP code, uses conditional logic to insert ads, text, media content and external service’s code. Ensures no content duplication.
6 * Author: Will Bontrager Software, LLC <will@willmaster.com>, Webcraftic <wordpress.webraftic@gmail.com>
7 * Version: 2.3.1
8 * Text Domain: insert-php
9 * Domain Path: /languages/
10 * Author URI: http://webcraftic.com
11 */
12
13 /**
14 * Developers who contributions in the development plugin:
15 *
16 * Will Bontrager
17 * ---------------------------------------------------------------------------------
18 * 1.0.0v - 1.3.0v Developed the first plugin version, which was named Insert php.
19 * This was the founder of this plugin.
20 *
21 * If you are a long-term user, you may be confused about the new plugin update.
22 * You’ve been using an old plugin – Insert php 1.3.0, and now got an extended
23 * product – Woody ad snippets. Insert php was the first plugin version to work
24 * with PHP code. It was created by Will Bontrager Software, LLC. In 2018, the
25 * Webcraftic studio started to actively develop the plugin. We’ve created a
26 * roadmap and released several powerful updates that help you to use PHP code
27 * more comfortable and secure. Now plugin supports not only PHP but other
28 * snippet types as well. We’ve decided to rename the plugin as Woody ad
29 * snippets. This name is more suitable for new and powerful plugin features.
30 *
31 * More information about the Insert PHP plugin can be found here:
32 * http://www.willmaster.com/software/WPplugins/go/iphphome_iphplugin
33 * ---------------------------------------------------------------------------------
34 *
35 * Alexander Kovalev
36 * ---------------------------------------------------------------------------------
37 * 1.3.0v - 2.0.6v. - Developed framework, plugin interface and plugin development.
38 * 2.0.6v. - 2.2.5v - Fix bugs, improvement some code parts for the plugin.
39 *
40 * Email: alex.kovalevv@gmail.com
41 * Personal card: https://alexkovalevv.github.io
42 * Personal repo: https://github.com/alexkovalevv
43 * ---------------------------------------------------------------------------------
44 *
45 * Alexander Vitkalov
46 * ---------------------------------------------------------------------------------
47 * 2.0.6v. - 2.2.5v - Development conditional logic for some snippets, added new snippets types,
48 * development snippets library, development import/export.
49 *
50 * Personal repo: https://github.com/nechin
51 * ---------------------------------------------------------------------------------
52 *
53 * Alexander Teshabaev
54 * ---------------------------------------------------------------------------------
55 * 2.0.6v. - 2.2.1v - Development snippets library and block for the Guttenberg editor.
56 *
57 * Personal repo: https://github.com/bologer
58 * ---------------------------------------------------------------------------------
59 *
60 * All development rights belong to @webcraftic studio.
61 * http://webcraftic.com
62 */
63
64 // Exit if accessed directly
65 if ( ! defined( 'ABSPATH' ) ) {
66 exit;
67 }
68
69 // @formatter:off
70
71
72
73 /**
74 * -----------------------------------------------------------------------------
75 * CHECK REQUIREMENTS
76 * Check compatibility with php and wp version of the user's site. As well as checking
77 * compatibility with other plugins from Webcraftic.
78 * -----------------------------------------------------------------------------
79 */
80
81 require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
82
83 $plugin_info = array(
84 'prefix' => 'wbcr_inp_',
85 'plugin_name' => 'wbcr_insert_php',
86 'plugin_title' => __( 'Woody ad snippets', 'insert-php' ),
87 'plugin_text_domain' => 'insert-php',
88
89 // PLUGIN SUPPORT
90 'support_details' => array(
91 'url' => 'https://r.freemius.com/3465/1916966/http://woody-ad-snippets.webcraftic.com',
92 'affiliate_url' => 'https://r.freemius.com/3465/1916966/',
93 'pages_map' => array(
94 'features' => 'premium-features', // {site}/premium-features
95 'pricing' => 'pricing', // {site}/prices
96 'support' => 'support', // {site}/support
97 'docs' => 'getting-started-with-woody-ad-snippets', // {site}/docs
98 ),
99 ),
100
101 // PLUGIN ADVERTS
102 'render_adverts' => true,
103 'adverts_settings' => array(
104 'dashboard_widget' => true, // show dashboard widget (default: false)
105 'right_sidebar' => true, // show adverts sidebar (default: false)
106 'notice' => true, // show notice message (default: false)
107 ),
108
109 // PLUGIN UPDATED SETTINGS
110 /*'has_updates' => false,
111 'updates_settings' => array(
112 'repository' => 'wordpress',
113 'slug' => 'woody-ad-snippets',
114 'maybe_rollback' => true,
115 'rollback_settings' => array(
116 'prev_stable_version' => '0.0.0',
117 ),
118 ),*/
119
120 // PLUGIN PREMIUM SETTINGS
121 'has_premium' => true,
122 'license_settings' => array(
123 'provider' => 'freemius',
124 'slug' => 'woody-ad-snippets-premium',
125 'plugin_id' => '3465',
126 'public_key' => 'pk_fc5703fe4f4fbc3e87f17fce5e0b8',
127 'price' => 19,
128 'has_updates' => true,
129 'updates_settings' => array(
130 'maybe_rollback' => true,
131 'rollback_settings' => array(
132 'prev_stable_version' => '0.0.0',
133 ),
134 ),
135 ),
136
137 // FRAMEWORK MODULES
138 'load_factory_modules' => array(
139 array( 'libs/factory/bootstrap', 'factory_bootstrap_423', 'admin' ),
140 array( 'libs/factory/forms', 'factory_forms_420', 'admin' ),
141 array( 'libs/factory/pages', 'factory_pages_422', 'admin' ),
142 array( 'libs/factory/types', 'factory_types_410' ),
143 array( 'libs/factory/taxonomies', 'factory_taxonomies_330' ),
144 array( 'libs/factory/metaboxes', 'factory_metaboxes_409', 'admin' ),
145 array( 'libs/factory/viewtables', 'factory_viewtables_410', 'admin' ),
146 array( 'libs/factory/shortcodes', 'factory_shortcodes_329', 'all' ),
147 array( 'libs/factory/freemius', 'factory_freemius_110', 'all' ),
148 array( 'libs/factory/adverts', 'factory_adverts_104', 'admin')
149 ),
150 );
151
152 /**
153 * Checks compatibility with WordPress, php and other plugins.
154 */
155 $wbcr_compatibility = new Wbcr_Factory422_Requirements( __FILE__, array_merge( $plugin_info, array(
156 'plugin_already_activate' => defined( 'WINP_PLUGIN_ACTIVE' ),
157 'required_php_version' => '5.4',
158 'required_wp_version' => '4.2.0',
159 ) ) );
160
161 /**
162 * If the plugin is compatible, it will continue its work, otherwise it will be stopped and the user will receive a warning.
163 */
164 if ( ! $wbcr_compatibility->check() ) {
165 return;
166 }
167
168 global $wbcr_inp_safe_mode;
169
170 $wbcr_inp_safe_mode = false;
171
172 // Set the constant that the plugin is activated
173 define( 'WINP_PLUGIN_ACTIVE', true );
174
175 define( 'WINP_PLUGIN_VERSION', $wbcr_compatibility->get_plugin_version() );
176
177 // Root directory of the plugin
178 define( 'WINP_PLUGIN_DIR', dirname( __FILE__ ) );
179
180 // Absolute url of the root directory of the plugin
181 define( 'WINP_PLUGIN_URL', plugins_url( null, __FILE__ ) );
182
183 // Relative url of the plugin
184 define( 'WINP_PLUGIN_BASE', plugin_basename( __FILE__ ) );
185
186 // The type of posts used for snippets types
187 define( 'WINP_SNIPPETS_POST_TYPE', 'wbcr-snippets' );
188
189 // The taxonomy used for snippets types
190 define( 'WINP_SNIPPETS_TAXONOMY', 'wbcr-snippet-tags' );
191
192 // The snippets types
193 define( 'WINP_SNIPPET_TYPE_PHP', 'php' );
194 define( 'WINP_SNIPPET_TYPE_TEXT', 'text' );
195 define( 'WINP_SNIPPET_TYPE_UNIVERSAL', 'universal' );
196 define( 'WINP_SNIPPET_TYPE_CSS', 'css' );
197 define( 'WINP_SNIPPET_TYPE_JS', 'js' );
198 define( 'WINP_SNIPPET_TYPE_HTML', 'html' );
199
200 // The snippet automatic insertion locations
201 define( 'WINP_SNIPPET_AUTO_HEADER', 'header' );
202 define( 'WINP_SNIPPET_AUTO_FOOTER', 'footer' );
203 define( 'WINP_SNIPPET_AUTO_BEFORE_POST', 'before_post' );
204 define( 'WINP_SNIPPET_AUTO_BEFORE_CONTENT', 'before_content' );
205 define( 'WINP_SNIPPET_AUTO_BEFORE_PARAGRAPH', 'before_paragraph' );
206 define( 'WINP_SNIPPET_AUTO_AFTER_PARAGRAPH', 'after_paragraph' );
207 define( 'WINP_SNIPPET_AUTO_AFTER_CONTENT', 'after_content' );
208 define( 'WINP_SNIPPET_AUTO_AFTER_POST', 'after_post' );
209 define( 'WINP_SNIPPET_AUTO_BEFORE_EXCERPT', 'before_excerpt' );
210 define( 'WINP_SNIPPET_AUTO_AFTER_EXCERPT', 'after_excerpt' );
211 define( 'WINP_SNIPPET_AUTO_BETWEEN_POSTS', 'between_posts' );
212 define( 'WINP_SNIPPET_AUTO_BEFORE_POSTS', 'before_posts' );
213 define( 'WINP_SNIPPET_AUTO_AFTER_POSTS', 'after_posts' );
214
215 require_once( WINP_PLUGIN_DIR . '/libs/factory/core/boot.php' );
216 require_once( WINP_PLUGIN_DIR . '/includes/compat.php' );
217 require_once( WINP_PLUGIN_DIR . '/includes/class.helpers.php' );
218 require_once( WINP_PLUGIN_DIR . '/includes/class.plugin.php' );
219
220 try {
221 new WINP_Plugin( __FILE__, array_merge( $plugin_info, array(
222 'plugin_version' => WINP_PLUGIN_VERSION,
223 'plugin_text_domain' => $wbcr_compatibility->get_text_domain(),
224 ) ) );
225 } catch ( Exception $exception ) {
226 // Plugin wasn't initialized due to an error
227 define( 'WINP_PLUGIN_THROW_ERROR', true );
228
229 $wbcr_plugin_error_func = function () use ( $exception ) {
230 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Woody Ad Snippets', $exception->getMessage(), $exception->getCode() );
231 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
232 };
233
234 add_action( 'admin_notices', $wbcr_plugin_error_func );
235 add_action( 'network_admin_notices', $wbcr_plugin_error_func );
236 }
237 // @formatter:on
238