summaryrefslogtreecommitdiff
blob: 92d178d32a7c2a020868afc4efe257fb4a73d1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
 * Plugin Name:  WordPress Mobile Pack
 * Plugin URI:  http://wordpress.org/plugins/wordpress-mobile-pack/
 * Description: WordPress Mobile Pack 3.0+ is a mobile plugin that helps you transform your WordPress-based content (posts/articles, categories, pages) into a progressive web application. It comes with multiple mobile app themes and extensions that you can purchase individually or as a bundle.
 * Author: WPMobilePack.com
 * Author URI: https://wpmobilepack.com/
 * Version: 3.2
 * Copyright (c) 2009 - 2017 James Pearce, mTLD Top Level Domain Limited, ribot, Forum Nokia, Appticles.com
 * License: The WordPress Mobile Pack is Licensed under the Apache License, Version 2.0
 * Text Domain: wordpress-mobile-pack
 */

require_once('core/config.php');
require_once('core/class-wmp.php');

/**
 * Used to load the required files on the plugins_loaded hook, instead of immediately.
 */
function wmobilepack_frontend_init() {

    require_once('frontend/class-application.php');
    new WMobilePack_Application();
}

function wmobilepack_admin_init() {

    require_once('admin/class-admin-init.php');
    new WMobilePack_Admin_Init();
}

if (class_exists( 'WMobilePack' ) && class_exists( 'WMobilePack' )) {

    global $wmobile_pack;
    $wmobile_pack = new WMobilePack();

    // Add hooks for activating & deactivating the plugin
    register_activation_hook(__FILE__, array(&$wmobile_pack, 'activate'));
    register_deactivation_hook(__FILE__, array(&$wmobile_pack, 'deactivate'));

    // Initialize the Wordpress Mobile Pack check logic and rendering
    if (is_admin()) {

        if (defined('DOING_AJAX') && DOING_AJAX) {

            require_once(WMP_PLUGIN_PATH . 'admin/class-admin-ajax.php');

            $wmobile_pack_ajax = new WMobilePack_Admin_Ajax();

			add_action('wp_ajax_wmp_theme_switch', array( &$wmobile_pack_ajax, 'theme_switch' ) );
            add_action('wp_ajax_wmp_theme_settings', array(&$wmobile_pack_ajax, 'theme_settings'));
			add_action('wp_ajax_wmp_theme_editimages', array(&$wmobile_pack_ajax, 'theme_editimages'));

            add_action('wp_ajax_wmp_content_status', array(&$wmobile_pack_ajax, 'content_status'));
            add_action('wp_ajax_wmp_content_pagedetails', array(&$wmobile_pack_ajax, 'content_pagedetails'));
            add_action('wp_ajax_wmp_content_order', array(&$wmobile_pack_ajax, 'content_order'));

            add_action('wp_ajax_wmp_settings_save', array(&$wmobile_pack_ajax, 'settings_save'));
            add_action('wp_ajax_wmp_settings_app', array(&$wmobile_pack_ajax, 'settings_app'));

            add_action( 'wp_ajax_wmp_premium_save', array( &$wmobile_pack_ajax, 'premium_save' ) );
            add_action( 'wp_ajax_wmp_premium_connect', array( &$wmobile_pack_ajax, 'premium_connect' ) );
            add_action( 'wp_ajax_wmp_premium_disconnect', array( &$wmobile_pack_ajax, 'premium_disconnect' ) );

            add_action('wp_ajax_wmp_join_waitlist', array(&$wmobile_pack_ajax, 'settings_waitlist'));
            add_action('wp_ajax_wmp_send_feedback', array(&$wmobile_pack_ajax, 'send_feedback'));

        } else {
            add_action('plugins_loaded', 'wmobilepack_admin_init');
        }

    } else {
        add_action('plugins_loaded', 'wmobilepack_frontend_init');
    }

}