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

236 lines 8.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 code snippets (PHP snippets | Insert PHP)
4 * Plugin URI: https://woodysnippet.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: Themeisle
7 * Version: 2.6.0
8 * WordPress Available: yes
9 * Requires License: no
10 * Text Domain: insert-php
11 * Domain Path: /languages/
12 * Author URI: https://themeisle.com
13 */
14
15 /**
16 * Developers who contributions in the development plugin:
17 *
18 * Will Bontrager
19 * ---------------------------------------------------------------------------------
20 * 1.0.0v - 1.3.0v Developed the first plugin version, which was named Insert php.
21 * This was the founder of this plugin.
22 *
23 * If you are a long-term user, you may be confused about the new plugin update.
24 * You’ve been using an old plugin – Insert php 1.3.0, and now got an extended
25 * product – Woody Code Snippets. Insert php was the first plugin version to work
26 * with PHP code. It was created by Will Bontrager Software, LLC. In 2018, the
27 * Webcraftic studio started to actively develop the plugin. We’ve created a
28 * roadmap and released several powerful updates that help you to use PHP code
29 * more comfortable and secure. Now plugin supports not only PHP but other
30 * snippet types as well. We’ve decided to rename the plugin as Woody ad
31 * snippets. This name is more suitable for new and powerful plugin features.
32 *
33 * More information about the Insert PHP plugin can be found here:
34 * http://www.willmaster.com/software/WPplugins/go/iphphome_iphplugin
35 * ---------------------------------------------------------------------------------
36 *
37 * Alexander Kovalev
38 * ---------------------------------------------------------------------------------
39 * 1.3.0v - 2.0.6v. - Developed framework, plugin interface and plugin development.
40 * 2.0.6v. - 2.2.5v - Fix bugs, improvement some code parts for the plugin.
41 *
42 * Email: alex.kovalevv@gmail.com
43 * Personal card: https://alexkovalevv.github.io
44 * Personal repo: https://github.com/alexkovalevv
45 * ---------------------------------------------------------------------------------
46 *
47 * Alexander Vitkalov
48 * ---------------------------------------------------------------------------------
49 * 2.0.6v. - 2.2.5v - Development conditional logic for some snippets, added new snippets types,
50 * development snippets library, development import/export.
51 *
52 * Personal repo: https://github.com/nechin
53 * ---------------------------------------------------------------------------------
54 *
55 * Artem Prihodko
56 * ---------------------------------------------------------------------------------
57 * 2.3.2v - current
58 *
59 * Email: webtemyk@yandex.ru
60 * Personal repo: https://github.com/temyk
61 * ---------------------------------------------------------------------------------
62 */
63
64 // Exit if accessed directly
65 if ( ! defined( 'ABSPATH' ) ) {
66 exit;
67 }
68 // @formatter:off
69
70
71
72 /**
73 * -----------------------------------------------------------------------------
74 * CHECK REQUIREMENTS
75 * Check compatibility with php and wp version of the user's site. As well as checking
76 * compatibility with other plugins from Webcraftic.
77 * -----------------------------------------------------------------------------
78 */
79
80 require_once dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php';
81
82 $plugin_info = [
83 'prefix' => 'wbcr_inp_',
84 'plugin_name' => 'wbcr_insert_php',
85 'plugin_title' => __( 'Woody Code Snippets', 'insert-php' ),
86 'plugin_text_domain' => 'insert-php',
87
88 // PLUGIN SUPPORT
89 'support_details' => [
90 'url' => 'https://r.freemius.com/3465/1916966/https://woodysnippet.com',
91 'affiliate_url' => 'https://r.freemius.com/3465/1916966/',
92 'pages_map' => [
93 'features' => 'premium-features', // {site}/premium-features
94 'pricing' => 'pricing', // {site}/prices
95 'support' => 'support', // {site}/support
96 'docs' => 'getting-started-with-woody-ad-snippets', // {site}/docs
97 ],
98 ],
99
100 // PLUGIN ADVERTS
101 'render_adverts' => true,
102 'adverts_settings' => [
103 'dashboard_widget' => true, // show dashboard widget (default: false)
104 'right_sidebar' => true, // show adverts sidebar (default: false)
105 'notice' => true, // show notice message (default: false)
106 ],
107
108 // PLUGIN UPDATED SETTINGS
109 /*
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' => [
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' => [
130 'maybe_rollback' => true,
131 'rollback_settings' => [
132 'prev_stable_version' => '0.0.0',
133 ],
134 ],
135 ],
136
137 // FRAMEWORK MODULES
138 'load_factory_modules' => [
139 [ 'libs/factory/bootstrap', 'factory_bootstrap_477', 'admin' ],
140 [ 'libs/factory/forms', 'factory_forms_475', 'admin' ],
141 [ 'libs/factory/pages', 'factory_pages_475', 'admin' ],
142 [ 'libs/factory/types', 'factory_types_415' ],
143 [ 'libs/factory/taxonomies', 'factory_taxonomies_335' ],
144 [ 'libs/factory/metaboxes', 'factory_metaboxes_415', 'admin' ],
145 [ 'libs/factory/viewtables', 'factory_viewtables_415', 'admin' ],
146 [ 'libs/factory/shortcodes', 'factory_shortcodes_335', 'all' ],
147 [ 'libs/factory/freemius', 'factory_freemius_165', 'all' ],
148 [ 'libs/factory/adverts', 'factory_adverts_153', 'admin' ],
149 ],
150 ];
151
152 /**
153 * Checks compatibility with WordPress, php and other plugins.
154 */
155 $wbcr_compatibility = new Wbcr_Factory475_Requirements( __FILE__, array_merge( $plugin_info, [
156 'plugin_already_activate' => defined( 'WINP_PLUGIN_ACTIVE' ),
157 'required_php_version' => '7.4',
158 'required_wp_version' => '5.6.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 define( 'WINP_PLUGIN_FILE', __FILE__ );
181
182 // Absolute url of the root directory of the plugin
183 define( 'WINP_PLUGIN_URL', plugins_url( '', __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 require_once WINP_PLUGIN_DIR . '/libs/factory/core/boot.php';
204 require_once WINP_PLUGIN_DIR . '/includes/compat.php';
205 require_once WINP_PLUGIN_DIR . '/includes/class.insertion.locations.php';
206 require_once WINP_PLUGIN_DIR . '/includes/class.helpers.php';
207 require_once WINP_PLUGIN_DIR . '/includes/class.plugin.php';
208
209 /*
210 * Woocommerce Insertion location
211 * @since 2.4
212 * */
213
214 global $winp_snippets_locations;
215 $winp_snippets_locations = new WINP_Insertion_Locations();
216
217 try {
218 require_once WINP_PLUGIN_DIR . '/vendor/autoload.php';
219 new WINP_Plugin( __FILE__, array_merge( $plugin_info, [
220 'plugin_version' => WINP_PLUGIN_VERSION,
221 'plugin_text_domain' => $wbcr_compatibility->get_text_domain(),
222 ] ) );
223 } catch ( Exception $exception ) {
224 // Plugin wasn't initialized due to an error
225 define( 'WINP_PLUGIN_THROW_ERROR', true );
226
227 $wbcr_plugin_error_func = function () use ( $exception ) {
228 $error = sprintf( 'The %s plugin has stopped. <b>Error:</b> %s Code: %s', 'Woody Ad Snippets', $exception->getMessage(), $exception->getCode() );
229 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
230 };
231
232 add_action( 'admin_notices', $wbcr_plugin_error_func );
233 add_action( 'network_admin_notices', $wbcr_plugin_error_func );
234 }
235 // @formatter:on
236