PATH:
home
/
letacommog
/
entrepro
/
wp-content
/
plugins
/
wp-all-import-pro
/
actions
<?php function pmxi_wp_ajax_save_import_functions(){ if ( ! check_ajax_referer( 'wp_all_import_secure', 'security', false )){ exit( json_encode(array('html' => __('Security check', 'wp_all_import_plugin'))) ); } if ( ! current_user_can( PMXI_Plugin::$capabilities ) ){ exit( json_encode(array('html' => __('Security check', 'wp_all_import_plugin'))) ); } $uploads = wp_upload_dir(); $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php'; $functions = apply_filters( 'import_functions_file_path', $functions ); $input = new PMXI_Input(); $post = $input->post('data', ''); $response = wp_remote_post('http://phpcodechecker.com/api', array( 'body' => array( 'code' => $post ) )); if (is_wp_error($response)) { if (strpos($post, "<?php") === false || strpos($post, "?>") === false) { exit(json_encode(array('result' => false, 'msg' => __('PHP code must be wrapped in "<?php" and "?>"', 'wp_all_import_plugin')))); die; } else { file_put_contents($functions, $post); } exit(json_encode(array('result' => true, 'msg' => __('File has been successfully updated.', 'wp_all_import_plugin')))); die; } else { $body = json_decode(wp_remote_retrieve_body($response), true); if ($body['errors'] === 'TRUE') { exit(json_encode(array('result' => false, 'msg' => $body['syntax']['message']))); die; } elseif($body['errors'] === 'FALSE') { if (strpos($post, "<?php") === false || strpos($post, "?>") === false) { exit(json_encode(array('result' => false, 'msg' => __('PHP code must be wrapped in "<?php" and "?>"', 'wp_all_import_plugin')))); die; } else { file_put_contents($functions, $post); } } } exit(json_encode(array('result' => true, 'msg' => __('File has been successfully updated.', 'wp_all_import_plugin')))); die; }
[+]
..
[-] add_attachment.php
[edit]
[-] admin_init.php
[edit]
[-] wp_ajax_save_import_scheduling.php
[edit]
[-] wp_ajax_get_bundle_post_type.php
[edit]
[-] wp_ajax_save_import_functions.php
[edit]
[-] admin_notices.php
[edit]
[-] wp_ajax_dismiss_notifications.php
[edit]
[-] wp_ajax_upload_resource.php
[edit]
[-] admin_menu.php
[edit]
[-] pmxi_after_xml_import.php
[edit]
[-] wp_loaded_99.php
[edit]
[-] wp_ajax_wp_all_import_api.php
[edit]
[-] delete_post.php
[edit]
[-] wp_ajax_test_images.php
[edit]
[-] wp_ajax_wpai_scheduling_dialog_content.php
[edit]
[-] wp_ajax_delete_import.php
[edit]
[-] attachment_updated.php
[edit]
[-] wp_ajax_auto_detect_cf.php
[edit]
[-] admin_head.php
[edit]
[-] pmxi_before_xml_import.php
[edit]
[-] delete_term.php
[edit]
[-] wp_ajax_import_failed.php
[edit]
[-] wpmu_new_blog.php
[edit]
[-] wp_ajax_auto_detect_sf.php
[edit]