| @@ -9,35 +9,21 @@ | ||
| 9 | 9 | use WPCoder\Optimization\HTMLMinifier; |
| 10 | 10 | use WPCoder\Publisher\Conditions; |
| 11 | 11 | use WPCoder\Publisher\EnqueueScript; |
| 12 | 12 | use WPCoder\Publisher\EnqueueStyle; |
| 13 | +use WPCoder\Publisher\PHPIncludes; | |
| 13 | 14 | use WPCoder\Publisher\Singleton; |
| 14 | 15 | |
| 15 | 16 | class WOWP_Public { |
| 16 | 17 | |
| 17 | 18 | public function __construct() { |
| 18 | - $this->include_global_php(); | |
| 19 | - | |
| 20 | 19 | add_shortcode( 'WP-Coder', [ $this, 'shortcode' ] ); |
| 21 | 20 | add_shortcode( WPCoder::SHORTCODE, [ $this, 'shortcode' ] ); |
| 22 | 21 | |
| 23 | 22 | add_action( 'wp_footer', [ $this, 'print_footer' ], 50 ); |
| 24 | - } | |
| 25 | 23 | |
| 26 | - public function include_global_php() { | |
| 27 | - $page_path = FolderManager::path_upload_dir() . 'global-php.php'; | |
| 28 | - $save_mode = isset( $_GET['wpcoder-safe-mode'] ) ? absint( $_GET['wpcoder-safe-mode'] ) : 0; | |
| 29 | - | |
| 30 | - if ( $save_mode === 1 ) { | |
| 31 | - return false; | |
| 32 | - } | |
| 33 | - if ( file_exists( $page_path ) && get_option( '_wpcoder_enable_php' ) ) { | |
| 34 | - require_once $page_path; | |
| 35 | - } | |
| 24 | + new PHPIncludes; | |
| 36 | 25 | } |
| 37 | - | |
| 38 | - | |
| 39 | - | |
| 40 | 26 | |
| 41 | 27 | public function shortcode( $atts, $shortcode_content = null ) { |
| 42 | 28 | if ( ! empty( $atts['id'] ) ) { |
| 43 | 29 | $result = DBManager::get_data_by_id( $atts['id'] ); |