summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wordpress-mobile-pack/admin/class-admin-ajax.php')
-rwxr-xr-xplugins/wordpress-mobile-pack/admin/class-admin-ajax.php144
1 files changed, 0 insertions, 144 deletions
diff --git a/plugins/wordpress-mobile-pack/admin/class-admin-ajax.php b/plugins/wordpress-mobile-pack/admin/class-admin-ajax.php
index ef29d790..d56452dc 100755
--- a/plugins/wordpress-mobile-pack/admin/class-admin-ajax.php
+++ b/plugins/wordpress-mobile-pack/admin/class-admin-ajax.php
@@ -50,24 +50,6 @@ if ( ! class_exists( 'WMobilePack_Admin_Ajax' ) ) {
/**
- *
- * Create a premium management object and return it
- *
- * @return object
- *
- */
- protected function get_premium_manager()
- {
- // attempt to load the settings json
- if (!class_exists('WMobilePack_Premium')) {
- require_once(WMP_PLUGIN_PATH . 'inc/class-wmp-premium.php');
- }
-
- return new WMobilePack_Premium();
- }
-
-
- /**
* Validate the new font settings, using the theme's configuration.
*
* @param $data = array with POST data
@@ -1088,132 +1070,6 @@ if ( ! class_exists( 'WMobilePack_Admin_Ajax' ) ) {
/**
*
- * Method used to validate and save the api key in the options table.
- *
- */
- public function premium_save(){
-
- if (current_user_can( 'manage_options' )){
-
- $status = 0;
-
- if (isset($_POST) && is_array($_POST) && !empty($_POST)){
-
- if (isset($_POST['api_key'])){
-
- if (preg_match('/^[a-zA-Z0-9]+$/', $_POST['api_key'])){
-
- // save options
- $status = 1;
-
- WMobilePack_Options::update_settings('premium_api_key',$_POST['api_key']);
- }
- }
- }
-
- echo $status;
- }
-
- exit();
- }
-
- /**
- *
- * Method used to save the premium settings
- *
- */
- public function premium_connect(){
-
- if (current_user_can('manage_options')){
-
- $status = 0;
-
- if (isset($_POST) && is_array($_POST) && !empty($_POST)){
-
- if (isset($_POST['api_key']) && isset($_POST['valid']) && isset($_POST['config_path'])){
-
- if (
- preg_match('/^[a-zA-Z0-9]+$/', $_POST['api_key']) &&
- ($_POST['valid'] == '0' || $_POST['valid'] == '1') &&
- $_POST['config_path'] != '' && filter_var($_POST['config_path'], FILTER_VALIDATE_URL)
- ){
-
- if ($_POST['api_key'] == WMobilePack_Options::get_setting('premium_api_key')) {
-
- $arr_data = array(
- 'premium_api_key' => $_POST['api_key'],
- 'premium_active' => $_POST['valid'],
- 'premium_config_path' => $_POST['config_path']
- );
-
- if (WMobilePack_Options::update_settings($arr_data)) {
-
- // attempt to load the settings json
- $premium_manager = $this->get_premium_manager();
- $json_config_premium = $premium_manager->set_premium_config();
-
- if ($json_config_premium !== false){
- $status = 1;
- } else {
- WMobilePack_Options::update_settings('premium_active', 0);
- }
- }
- }
- }
- }
- }
-
- echo $status;
-
- }
-
- exit();
- }
-
-
- /**
- *
- * Method used to disconnect the dashboard from Appticles and revert to basic theme
- *
- */
- public function premium_disconnect(){
-
- if (current_user_can('manage_options')){
-
- $status = 0;
-
- if (isset($_POST) && is_array($_POST) && !empty($_POST)){
-
- if (isset($_POST['api_key']) && isset($_POST['active'])){
-
- if (preg_match('/^[a-zA-Z0-9]+$/', $_POST['api_key']) && $_POST['active'] == 0){
-
- $status = 1;
-
- // delete transient with the json config
- if (get_transient(WMobilePack_Options::$transient_prefix."premium_config_path") !== false)
- delete_transient(WMobilePack_Options::$transient_prefix.'premium_config_path');
-
- $arr_data = array(
- 'premium_api_key' => '',
- 'premium_active' => 0,
- 'premium_config_path' => ''
- );
-
- // save options
- WMobilePack_Options::update_settings($arr_data);
- }
- }
- }
-
- echo $status;
- }
-
- exit();
- }
-
- /**
- *
* Method used to send a feedback e-mail from the admin
*
* Handle request, then display 1 for success and 0 for error.