PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / 2.3.10
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts v2.3.10
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.10, at insert_php.php

241 lines 9.6 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.10
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 * Artem Prihodko
54 * ---------------------------------------------------------------------------------
55 * 2.3.2v - current
56 *
57 * Email: webtemyk@yandex.ru
58 * Personal repo: https://github.com/temyk
59 * ---------------------------------------------------------------------------------
60 *
61 * All development rights belong to @webcraftic studio.
62 * http://webcraftic.com
63 */
64
65 // Exit if accessed directly
66 if ( ! defined( 'ABSPATH' ) ) {
67 exit;
68 }
69
70 // @formatter:off
71
72
73
74 /**
75 * -----------------------------------------------------------------------------
76 * CHECK REQUIREMENTS
77 * Check compatibility with php and wp version of the user's site. As well as checking
78 * compatibility with other plugins from Webcraftic.
79 * -----------------------------------------------------------------------------
80 */
81
82 require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
83
84 $plugin_info = array(
85 'prefix' => 'wbcr_inp_',
86 'plugin_name' => 'wbcr_insert_php',
87 'plugin_title' => __( 'Woody ad snippets', 'insert-php' ),
88 'plugin_text_domain' => 'insert-php',
89
90 // PLUGIN SUPPORT
91 'support_details' => array(
92 'url' => 'https://r.freemius.com/3465/1916966/http://woody-ad-snippets.webcraftic.com',
93 'affiliate_url' => 'https://r.freemius.com/3465/1916966/',
94 'pages_map' => array(
95 'features' => 'premium-features', // {site}/premium-features
96 'pricing' => 'pricing', // {site}/prices
97 'support' => 'support', // {site}/support
98 'docs' => 'getting-started-with-woody-ad-snippets', // {site}/docs
99 ),
100 ),
101
102 // PLUGIN ADVERTS
103 'render_adverts' => true,
104 'adverts_settings' => array(
105 'dashboard_widget' => true, // show dashboard widget (default: false)
106 'right_sidebar' => true, // show adverts sidebar (default: false)
107 'notice' => true, // show notice message (default: false)
108 ),
109
110 // PLUGIN UPDATED SETTINGS
111 /*'has_updates' => false,
112 'updates_settings' => array(
113 'repository' => 'wordpress',
114 'slug' => 'woody-ad-snippets',
115 'maybe_rollback' => true,
116 'rollback_settings' => array(
117 'prev_stable_version' => '0.0.0',
118 ),
119 ),*/
120
121 // PLUGIN PREMIUM SETTINGS
122 'has_premium' => true,
123 'license_settings' => array(
124 'provider' => 'freemius',
125 'slug' => 'woody-ad-snippets-premium',
126 'plugin_id' => '3465',
127 'public_key' => 'pk_fc5703fe4f4fbc3e87f17fce5e0b8',
128 'price' => 19,
129 'has_updates' => true,
130 'updates_settings' => array(
131 'maybe_rollback' => true,
132 'rollback_settings' => array(
133 'prev_stable_version' => '0.0.0',
134 ),
135 ),
136 ),
137
138 // FRAMEWORK MODULES
139 'load_factory_modules' => array(
140 array( 'libs/factory/bootstrap', 'factory_bootstrap_433', 'admin' ),
141 array( 'libs/factory/forms', 'factory_forms_430', 'admin' ),
142 array( 'libs/factory/pages', 'factory_pages_432', 'admin' ),
143 array( 'libs/factory/types', 'factory_types_410' ),
144 array( 'libs/factory/taxonomies', 'factory_taxonomies_330' ),
145 array( 'libs/factory/metaboxes', 'factory_metaboxes_409', 'admin' ),
146 array( 'libs/factory/viewtables', 'factory_viewtables_410', 'admin' ),
147 array( 'libs/factory/shortcodes', 'factory_shortcodes_329', 'all' ),
148 array( 'libs/factory/freemius', 'factory_freemius_120', 'all' ),
149 array( 'libs/factory/adverts', 'factory_adverts_112', 'admin'),
150 array( 'libs/factory/feedback', 'factory_feedback_106', 'admin')
151 ),
152 );
153
154 /**
155 * Checks compatibility with WordPress, php and other plugins.
156 */
157 $wbcr_compatibility = new Wbcr_Factory432_Requirements( __FILE__, array_merge( $plugin_info, array(
158 'plugin_already_activate' => defined( 'WINP_PLUGIN_ACTIVE' ),
159 'required_php_version' => '5.4',
160 'required_wp_version' => '4.2.0',
161 ) ) );
162
163 /**
164 * If the plugin is compatible, it will continue its work, otherwise it will be stopped and the user will receive a warning.
165 */
166 if ( ! $wbcr_compatibility->check() ) {
167 return;
168 }
169
170 global $wbcr_inp_safe_mode;
171
172 $wbcr_inp_safe_mode = false;
173
174 // Set the constant that the plugin is activated
175 define( 'WINP_PLUGIN_ACTIVE', true );
176
177 define( 'WINP_PLUGIN_VERSION', $wbcr_compatibility->get_plugin_version() );
178
179 // Root directory of the plugin
180 define( 'WINP_PLUGIN_DIR', dirname( __FILE__ ) );
181
182 // Absolute url of the root directory of the plugin
183 define( 'WINP_PLUGIN_URL', plugins_url( null, __FILE__ ) );
184
185 // Relative url of the plugin
186 define( 'WINP_PLUGIN_BASE', plugin_basename( __FILE__ ) );
187
188 // The type of posts used for snippets types
189 define( 'WINP_SNIPPETS_POST_TYPE', 'wbcr-snippets' );
190
191 // The taxonomy used for snippets types
192 define( 'WINP_SNIPPETS_TAXONOMY', 'wbcr-snippet-tags' );
193
194 // The snippets types
195 define( 'WINP_SNIPPET_TYPE_PHP', 'php' );
196 define( 'WINP_SNIPPET_TYPE_TEXT', 'text' );
197 define( 'WINP_SNIPPET_TYPE_UNIVERSAL', 'universal' );
198 define( 'WINP_SNIPPET_TYPE_CSS', 'css' );
199 define( 'WINP_SNIPPET_TYPE_JS', 'js' );
200 define( 'WINP_SNIPPET_TYPE_HTML', 'html' );
201 define( 'WINP_SNIPPET_TYPE_AD', 'advert' );
202
203 // The snippet automatic insertion locations
204 define( 'WINP_SNIPPET_AUTO_HEADER', 'header' );
205 define( 'WINP_SNIPPET_AUTO_FOOTER', 'footer' );
206 define( 'WINP_SNIPPET_AUTO_BEFORE_POST', 'before_post' );
207 define( 'WINP_SNIPPET_AUTO_BEFORE_CONTENT', 'before_content' );
208 define( 'WINP_SNIPPET_AUTO_BEFORE_PARAGRAPH', 'before_paragraph' );
209 define( 'WINP_SNIPPET_AUTO_AFTER_PARAGRAPH', 'after_paragraph' );
210 define( 'WINP_SNIPPET_AUTO_AFTER_CONTENT', 'after_content' );
211 define( 'WINP_SNIPPET_AUTO_AFTER_POST', 'after_post' );
212 define( 'WINP_SNIPPET_AUTO_BEFORE_EXCERPT', 'before_excerpt' );
213 define( 'WINP_SNIPPET_AUTO_AFTER_EXCERPT', 'after_excerpt' );
214 define( 'WINP_SNIPPET_AUTO_BETWEEN_POSTS', 'between_posts' );
215 define( 'WINP_SNIPPET_AUTO_BEFORE_POSTS', 'before_posts' );
216 define( 'WINP_SNIPPET_AUTO_AFTER_POSTS', 'after_posts' );
217
218 require_once( WINP_PLUGIN_DIR . '/libs/factory/core/boot.php' );
219 require_once( WINP_PLUGIN_DIR . '/includes/compat.php' );
220 require_once( WINP_PLUGIN_DIR . '/includes/class.helpers.php' );
221 require_once( WINP_PLUGIN_DIR . '/includes/class.plugin.php' );
222
223 try {
224 new WINP_Plugin( __FILE__, array_merge( $plugin_info, array(
225 'plugin_version' => WINP_PLUGIN_VERSION,
226 'plugin_text_domain' => $wbcr_compatibility->get_text_domain(),
227 ) ) );
228 } catch ( Exception $exception ) {
229 // Plugin wasn't initialized due to an error
230 define( 'WINP_PLUGIN_THROW_ERROR', true );
231
232 $wbcr_plugin_error_func = function () use ( $exception ) {
233 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Woody Ad Snippets', $exception->getMessage(), $exception->getCode() );
234 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
235 };
236
237 add_action( 'admin_notices', $wbcr_plugin_error_func );
238 add_action( 'network_admin_notices', $wbcr_plugin_error_func );
239 }
240 // @formatter:on
241