PluginProbe
Advanced Ads – Ad Manager & AdSense / 1.4.2
Advanced Ads – Ad Manager & AdSense v1.4.2
2.0.26 2.0.25 2.0.24 2.0.23 2.0.22 2.0.21 1.38.0 1.39.0 1.39.1 1.39.2 1.39.3 1.39.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.40.0 1.40.1 1.40.2 All 348 releases
advanced-ads / advanced-ads.php
advanced-ads.php
97 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Advanced Ads.
4 *
5 * @package Advanced_Ads_Admin
6 * @author Thomas Maier <thomas.maier@webgilde.com>
7 * @license GPL-2.0+
8 * @link http://webgilde.com
9 * @copyright 2013-2014 Thomas Maier, webgilde GmbH
10 *
11 * @wordpress-plugin
12 * Plugin Name: Advanced Ads
13 * Plugin URI: http://wpadvancedads.com
14 * Description: Manage and optimize your ads in WordPress
15 * Version: 1.4.2
16 * Author: Thomas Maier
17 * Author URI: http://webgilde.com
18 * Text Domain: advanced-ads
19 * License: GPL-2.0+
20 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
21 * Domain Path: /languages
22 */
23
24 // If this file is called directly, abort.
25 if ( ! defined( 'WPINC' ) ) {
26 die;
27 }
28
29 // only load if not already existing (maybe included from another plugin)
30 if( defined('ADVADS_BASE_PATH') ) {
31 return ;
32 }
33
34 // load basic path to the plugin
35 define('ADVADS_BASE_PATH', plugin_dir_path(__FILE__));
36 define('ADVADS_BASE_URL', plugin_dir_url(__FILE__));
37 define('ADVADS_BASE_DIR', dirname( plugin_basename( __FILE__ ) )); // directory of the plugin without any paths
38 // general and global slug, e.g. to store options in WP, textdomain
39 define('ADVADS_SLUG', 'advanced-ads');
40
41 /*----------------------------------------------------------------------------*
42 * Autoloading Objects
43 *----------------------------------------------------------------------------*/
44 if (!class_exists('Advanced_Ads', true)) {
45 require_once( plugin_dir_path( __FILE__ ) . 'includes/autoloader.php' );
46 require_once( plugin_dir_path( __FILE__ ) . 'public/class-advanced-ads.php' );
47 spl_autoload_register(array('Advads_Autoloader', 'load'));
48 }
49
50 /*----------------------------------------------------------------------------*
51 * Public-Facing Functionality
52 *----------------------------------------------------------------------------*/
53
54 /*
55 * Register hooks that are fired when the plugin is activated or deactivated.
56 * When the plugin is deleted, the uninstall.php file is loaded.
57 *
58 */
59 register_activation_hook( __FILE__, array( 'Advanced_Ads', 'activate' ) );
60 register_deactivation_hook( __FILE__, array( 'Advanced_Ads', 'deactivate' ) );
61
62 add_action( 'plugins_loaded', array( 'Advanced_Ads', 'get_instance' ) );
63
64 /*----------------------------------------------------------------------------*
65 * Dashboard and Administrative Functionality
66 *----------------------------------------------------------------------------*/
67
68 if( defined('DOING_AJAX') ) {
69 new Advads_Ad_Ajax_Callbacks;
70 }
71 // load ad conditions array
72 require_once( plugin_dir_path( __FILE__ ) . 'includes/array_ad_conditions.php' );
73
74 if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
75 require_once( plugin_dir_path( __FILE__ ) . 'admin/class-advanced-ads-admin.php' );
76 add_action( 'plugins_loaded', array( 'Advanced_Ads_Admin', 'get_instance' ) );
77 }
78
79 // load public functions
80 require_once( plugin_dir_path( __FILE__ ) . 'public/functions.php' );
81
82 // load widget
83 require_once( plugin_dir_path( __FILE__ ) . 'classes/widget.php' );
84 function advads_widget_init() {
85 register_widget('Advads_Widget');
86 }
87
88 add_action('widgets_init', 'advads_widget_init');
89
90 // Load advads extensions
91 require_once(ADVADS_BASE_PATH . 'modules/gadsense/main.php');
92
93 // load modules, if they exist
94 if(file_exists(ADVADS_BASE_PATH . 'modules/pro/advads_pro.php')){
95 require_once(ADVADS_BASE_PATH . 'modules/pro/advads_pro.php');
96 }
97