| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package ONTRApages |
| 4 |
*/ |
| 5 |
/* |
| 6 |
Plugin Name: ONTRApages |
| 7 |
Plugin URI: http://ONTRApages.com |
| 8 |
Description: ONTRApages for WordPress allows ONTRAPORT & ONTRApages Premium users to connect to their accounts and easily host their landing pages on their own WordPress sites. |
| 9 |
Version: 1.2.11 |
| 10 |
Author: ONTRAPORT |
| 11 |
Author URI: http://ONTRAPORT.com/ |
| 12 |
License: GPLv2 or later |
| 13 |
Text Domain: ONTRApages.com |
| 14 |
*/ |
| 15 |
|
| 16 |
/* |
| 17 |
This program is free software; you can redistribute it and/or |
| 18 |
modify it under the terms of the GNU General Public License |
| 19 |
as published by the Free Software Foundation; either version 2 |
| 20 |
of the License, or (at your option) any later version. |
| 21 |
|
| 22 |
This program is distributed in the hope that it will be useful, |
| 23 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 25 |
GNU General Public License for more details. |
| 26 |
|
| 27 |
You should have received a copy of the GNU General Public License |
| 28 |
along with this program; if not, write to the Free Software |
| 29 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 30 |
*/ |
| 31 |
|
| 32 |
// Don't show anything if called directly |
| 33 |
if ( !function_exists( 'add_action' ) ) |
| 34 |
{ |
| 35 |
exit; |
| 36 |
} |
| 37 |
|
| 38 |
define( 'ONTRAPAGES_VERSION', '1.2.11' ); |
| 39 |
define( 'ONTRAPAGES__MINIMUM_WP_VERSION', '4.0' ); |
| 40 |
define( 'ONTRAPAGES__PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 41 |
define( 'ONTRAPAGES__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 42 |
define( 'OPAPI', 'https://api.ontraport.com/1/' ); |
| 43 |
define( 'OPGAPI', 'https://api.ontrapages.com/' ); |
| 44 |
|
| 45 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'OPCoreFunctions.php' ); |
| 46 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'OPAdminSettings.php' ); |
| 47 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'OPObjects.php' ); |
| 48 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'ONTRApage.php' ); |
| 49 |
// require_once( ONTRAPAGES__PLUGIN_DIR . 'ONTRAforms.php' ); |
| 50 |
|
| 51 |
// Run these functions on WP plugin activation and deactivation |
| 52 |
register_activation_hook( __FILE__, array( 'OPAdminSettings', 'ontrapagesActivation' ) ); |
| 53 |
register_deactivation_hook( __FILE__, array( 'OPAdminSettings', 'ontrapagesDeactivation' ) ); |
| 54 |
|
| 55 |
// Initialize OP page and form settings |
| 56 |
add_action( 'init', array( 'ONTRApage', 'init' ) ); |
| 57 |
// add_action( 'init', array( 'ONTRAforms', 'init' ) ); |
| 58 |
|
| 59 |
// Admin settings |
| 60 |
if ( is_admin() ) |
| 61 |
{ |
| 62 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'OPObjects.php' ); |
| 63 |
require_once( ONTRAPAGES__PLUGIN_DIR . 'ONTRApagesAdmin.php' ); |
| 64 |
// require_once( ONTRAPAGES__PLUGIN_DIR . 'ONTRAformsAdmin.php' ); |
| 65 |
|
| 66 |
// Initialize OP Admin settings and add admin scripts / styles |
| 67 |
add_action( 'admin_menu', array( 'OPAdminSettings', 'adminSettings' ) ); |
| 68 |
add_action( 'admin_enqueue_scripts', array( 'OPAdminSettings', 'adminScripts' ) ); |
| 69 |
|
| 70 |
// Initialize any necessary Admin Settings &/or checks |
| 71 |
add_action( 'init', array( 'OPAdminSettings', 'init' ) ); |
| 72 |
|
| 73 |
// Initialize OP Admin page and form settings |
| 74 |
add_action( 'init', array( 'ONTRApagesAdmin', 'init' ) ); |
| 75 |
// add_action( 'init', array( 'ONTRAformsAdmin', 'init' ) ); |
| 76 |
|
| 77 |
// Fix the wrong API settings that were set in v1.1 |
| 78 |
if ( get_option('opAPIFix') === false ) |
| 79 |
{ |
| 80 |
OPAdminSettings::fixAPISettings(); |
| 81 |
} |
| 82 |
//We need to hook into after plugins are loaded so we can hook into PilotPress |
| 83 |
add_action("plugins_loaded", array( "OPAdminSettings", "pluginsLoaded")); |
| 84 |
|
| 85 |
} |
| 86 |
|