| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: WP Data Access |
| 4 |
* Plugin URI: https://wpdataaccess.com/ |
| 5 |
* Description: A WordPress data administration and publication tool that helps you to manage your Wordpress data and database and build data driven WordPress apps that run in the WordPress dashboard and add dynamic WordPress tables to your website. |
| 6 |
* Version: 2.0.13 |
| 7 |
* Author: Peter Schulz |
| 8 |
* Author URI: https://www.linkedin.com/in/peterschulznl/ |
| 9 |
* Text Domain: wp-data-access |
| 10 |
* License: GPL-2.0+ |
| 11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 12 |
* Domain Path: /languages |
| 13 |
* |
| 14 |
* @package plugin |
| 15 |
* @author Peter Schulz |
| 16 |
* @since 1.0.0 |
| 17 |
*/ |
| 18 |
|
| 19 |
if ( ! defined( 'WPINC' ) ) { |
| 20 |
die; |
| 21 |
} |
| 22 |
|
| 23 |
// Load WPDataAccess namespace. |
| 24 |
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
| 25 |
|
| 26 |
/** |
| 27 |
* Activate plugin |
| 28 |
* |
| 29 |
* @author Peter Schulz |
| 30 |
* @since 1.0.0 |
| 31 |
*/ |
| 32 |
function activate_wp_data_access() { |
| 33 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-data-access-switch.php'; |
| 34 |
WP_Data_Access_Switch::activate(); |
| 35 |
} |
| 36 |
register_activation_hook( __FILE__, 'activate_wp_data_access' ); |
| 37 |
|
| 38 |
/** |
| 39 |
* Deactivate plugin |
| 40 |
* |
| 41 |
* @author Peter Schulz |
| 42 |
* @since 1.0.0 |
| 43 |
*/ |
| 44 |
function deactivate_wp_data_access() { |
| 45 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-data-access-switch.php'; |
| 46 |
WP_Data_Access_Switch::deactivate(); |
| 47 |
} |
| 48 |
register_deactivation_hook( __FILE__, 'deactivate_wp_data_access' ); |
| 49 |
|
| 50 |
/** |
| 51 |
* Check if database needs to be updated |
| 52 |
* |
| 53 |
* @author Peter Schulz |
| 54 |
* @since 1.5.2 |
| 55 |
*/ |
| 56 |
function wpda_update_db_check() { |
| 57 |
if (WPDataAccess\WPDA::OPTION_WPDA_VERSION[1] !== get_option( WPDataAccess\WPDA::OPTION_WPDA_VERSION[0] ) ) { |
| 58 |
activate_wp_data_access(); |
| 59 |
} |
| 60 |
} |
| 61 |
add_action( 'plugins_loaded', 'wpda_update_db_check' ); |
| 62 |
|
| 63 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-data-access.php'; |
| 64 |
/** |
| 65 |
* Start plugin |
| 66 |
* |
| 67 |
* @author Peter Schulz |
| 68 |
* @since 1.0.0 |
| 69 |
*/ |
| 70 |
function run_wp_data_access() { |
| 71 |
$wpdataaccess = new WP_Data_Access(); |
| 72 |
$wpdataaccess->run(); |
| 73 |
} |
| 74 |
|
| 75 |
run_wp_data_access(); |
| 76 |
|