Changeset 2054055
- Timestamp:
- 03/20/2019 02:34:16 PM (7 years ago)
- Location:
- code-injection/trunk
- Files:
-
- 1 added
- 9 edited
-
assets/code-editor.css (added)
-
includes/assets-manager.php (modified) (2 diffs)
-
includes/calendar-heatmap.php (modified) (1 diff)
-
includes/code-metabox.php (modified) (5 diffs)
-
includes/code-type.php (modified) (2 diffs)
-
includes/database.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
uninstall.php (modified) (1 diff)
-
wp-code-injection-plugin-widget.php (modified) (1 diff)
-
wp-code-injection.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code-injection/trunk/includes/assets-manager.php
r2051415 r2054055 54 54 * @author Arman Afzal <rman.afzal@gmail.com> 55 55 * @package WP_Divan_Control_Panel 56 * @version 2.2.957 56 */ 58 57 … … 101 100 wp_register_style('dcp-tag-editor', plugins_url('assets/jquery.tag-editor.css', $this->plugin), [], $ver, 'all'); 102 101 102 103 wp_register_style('custom-code-editor', plugins_url('assets/code-editor.css', $this->plugin), [], $ver, 'all'); 104 103 105 104 106 } -
code-injection/trunk/includes/calendar-heatmap.php
r2051415 r2054055 54 54 * @author Arman Afzal <rman.afzal@gmail.com> 55 55 * @package WP_Divan_Control_Panel 56 * @version 2.2.957 56 */ 58 57 -
code-injection/trunk/includes/code-metabox.php
r2051415 r2054055 55 55 * @author Arman Afzal <rman.afzal@gmail.com> 56 56 * @package WP_Divan_Control_Panel 57 * @version 2.2.958 57 */ 59 58 … … 68 67 'code_tracking' => true, 69 68 'code_enabled' => true, 69 'code_is_plugin' => false, 70 'code_activator_key' => '' 70 71 ]; 71 72 … … 184 185 185 186 extract( $code_options ); 186 187 187 wp_nonce_field('code-settings-nonce', 'code_meta_box_nonce'); 188 189 $ignore_keys = get_option('wp_dcp_unsafe_ignore_keys', false); 190 $use_php = get_option('wp_dcp_unsafe_widgets_php', false); 188 191 189 192 ?> … … 201 204 <?php _e("Tracking" , self::$text_domain); ?> 202 205 </label> 206 <p class="description"> 207 <?php _e("Plugins are not able to be tracked." , self::$text_domain); ?> 208 </p> 203 209 </p> 204 210 <!-- 'tracking' section --> 211 212 213 <!-- 'plugin' section --> 214 <p> 215 216 <label> 217 <input <?php checked($code_is_plugin , true); ?> type="checkbox" id="code_is_plugin" name="code_is_plugin" value="1" /> 218 <?php _e("Is Plugin" , self::$text_domain); ?> 219 </label> 220 221 <?php if(!$use_php) : ?> 222 223 <p class="description"> 224 <?php _e("Running PHP codes has disabled by the administrator." , self::$text_domain); ?> 225 </p> 226 227 <?php endif; ?> 228 229 <?php if(!$ignore_keys) : ?> 230 231 <p><strong><?php _e("Activator Key:" , self::$text_domain); ?></strong></p> 232 233 <input type="text" style="width:100%;" id="code_activator_key" name="code_activator_key" value="<?php echo $code_activator_key; ?>" /> 234 235 <?php else: ?> 236 237 <input type="hidden" id="code_activator_key" name="code_activator_key" value="<?php echo $code_activator_key; ?>" /> 238 239 <?php endif; ?> 240 241 </p> 242 <!-- 'plugin' section --> 243 205 244 206 245 <!-- 'enable' section --> … … 213 252 <!-- 'enable' section --> 214 253 254 215 255 <?php 216 256 -
code-injection/trunk/includes/code-type.php
r2051415 r2054055 55 55 * @author Arman Afzal <rman.afzal@gmail.com> 56 56 * @package WP_Divan_Control_Panel 57 * @version 2.2.958 57 */ 59 58 … … 105 104 wp_enqueue_style('dcp-codemirror'); 106 105 wp_enqueue_style('dcp-codemirror-dracula'); 106 wp_enqueue_style('custom-code-editor'); 107 107 108 108 //codemirror -
code-injection/trunk/includes/database.php
r2051415 r2054055 54 54 * @author Arman Afzal <rman.afzal@gmail.com> 55 55 * @package WP_Divan_Control_Panel 56 * @version 2.2.957 56 */ 58 57 -
code-injection/trunk/readme.txt
r2051415 r2054055 3 3 Tags: code, snippets, injection 4 4 Requires at least: 4.5.0 5 Tested up to: 5. 0.35 Tested up to: 5.1.1 6 6 Requires PHP: 5.2.4 7 Stable tag: 2. 2.87 Stable tag: 2.3.0 8 8 License: Apache License, Version 2.0 9 9 License URI: http://www.apache.org/licenses/LICENSE-2.0 … … 13 13 == Changelog == 14 14 15 = 2.2.8 = 16 * [fix] Assets Error 17 * [feature] Codes Category 15 = 2.3.0 = 16 * [feature] Code as plugin 18 17 19 18 [More](https://github.com/Rmanaf/wp-code-injection/blob/master/CHANGELOG.md) -
code-injection/trunk/uninstall.php
r2051415 r2054055 53 53 54 54 /** 55 * @author Arman Afzal <rman.afzal@gmail.com> 55 56 * @package WP_Divan_Control_Panel 56 * @version 2.2.957 57 */ 58 58 59 59 60 if (!defined('WP_UNINSTALL_PLUGIN')) { -
code-injection/trunk/wp-code-injection-plugin-widget.php
r2051415 r2054055 55 55 * @author Arman Afzal <rman.afzal@gmail.com> 56 56 * @package WP_Divan_Control_Panel 57 * @version 2.2.958 57 */ 59 58 -
code-injection/trunk/wp-code-injection.php
r2051415 r2054055 56 56 Plugin URI: https://wordpress.org/plugins/code-injection 57 57 Description: Allows You to inject code snippets into the pages by just using the Wordpress shortcode 58 Version: 2. 2.958 Version: 2.3.0 59 59 Author: Arman Afzal 60 60 Author URI: https://github.com/Rmanaf … … 66 66 * @author Arman Afzal <rman.afzal@gmail.com> 67 67 * @package WP_Divan_Control_Panel 68 * @version 2.2.969 68 */ 70 69 … … 152 151 add_action('widgets_init', [$this, 'widgets_init']); 153 152 153 add_action('plugins_loaded', [$this, 'load_extra_plugins'] ); 154 154 155 add_filter('dcp_shortcodes_list', [&$this, 'add_shortcode_to_list']); 156 157 155 158 156 159 } … … 618 621 619 622 623 /** 624 * loads codes as plugin 625 * @since 2.2.9 626 */ 627 public function load_extra_plugins() 628 { 629 630 global $wpdb; 631 632 $instance = $this; 633 634 $use_php = get_option('wp_dcp_unsafe_widgets_php', false); 635 636 if(!$use_php) 637 { 638 return; 639 } 640 641 $ignore_keys = get_option('wp_dcp_unsafe_ignore_keys', false); 642 643 $keys = get_option('wp_dcp_unsafe_keys' , ''); 644 645 $query = " 646 SELECT $wpdb->posts.*, $wpdb->postmeta.* 647 FROM $wpdb->posts, $wpdb->postmeta 648 WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id 649 AND $wpdb->postmeta.meta_key = 'code_options' 650 AND $wpdb->posts.post_status = 'publish' 651 AND $wpdb->posts.post_type = 'code' 652 AND $wpdb->posts.post_date < NOW() 653 ORDER BY $wpdb->posts.post_date DESC 654 "; 655 656 $codes = $wpdb->get_results($query, OBJECT); 657 658 659 $plugins = array_filter($codes , function($element) use ($instance, $ignore_keys, $keys) { 660 661 $options = maybe_unserialize($element->meta_value); 662 663 extract($options); 664 665 $is_plugin = isset($code_is_plugin) && $code_is_plugin == '1'; 666 667 if(!$is_plugin || $code_enabled == false) 668 { 669 return false; 670 } 671 672 if($ignore_keys) 673 { 674 return true; 675 } 676 677 return isset($code_activator_key) && in_array($code_activator_key , $instance->extract_keys($keys)); 678 679 }); 680 681 foreach($plugins as $p) 682 { 683 eval("?" . ">" . $p->post_content ); 684 } 685 686 } 687 688 689 620 690 621 691 /**
Note: See TracChangeset
for help on using the changeset viewer.