PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 3.0.1
Taskbuilder – Project Management & Task Management Tool With Kanban Board v3.0.1
6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 All 57 releases
taskbuilder / taskbuilder.php

taskbuilder.php in Taskbuilder – Project Management & Task Management Tool With Kanban Board 3.0.1, at taskbuilder.php

118 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Taskbuilder
4 * Plugin URI: https://wordpress.org/plugins/taskbuilder/
5 * Description: Wordpress Project & Task Management plugin. Easy to keep track of projects & tasks!
6 * Version: 3.0.1
7 * Author: Taskbuilder Team
8 * Author URI: https://taskbuilder.net/
9 * Requires at least: 4.4
10 * Tested up to: 6.5.5
11 * Text Domain: taskbuilder
12 * Domain Path: /lang
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly
17 }
18
19 if ( ! class_exists( 'WP_Taskbuilder' ) ) :
20
21 final class WP_Taskbuilder {
22 public $version = '3.0.1';
23 public function __construct() {
24 // define global constants
25 $this->define_constants();
26 // Include required files and classes
27 $this->includes();
28 add_action( 'init', array($this,'load_textdomain') );
29 add_action( 'init', array( $this, 'wppm_check_download_file') );
30 register_deactivation_hook( __FILE__, array($this,'deactivate') );
31 }
32
33 function define_constants() {
34 $this->define('WPPM_STORE_URL', 'https://taskbuilder.net/');
35 $this->define('WPPM_PLUGIN_FILE', __FILE__);
36 $this->define('WPPM_ABSPATH', dirname(__FILE__) . '/');
37 $this->define('WPPM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
38 $this->define('WPPM_PLUGIN_BASENAME', plugin_basename(__FILE__));
39 $this->define('WPPM_VERSION', $this->version);
40 }
41
42 function load_textdomain(){
43 $locale = apply_filters( 'plugin_locale', get_locale(), 'taskbuilder' );
44 load_textdomain( 'taskbuilder', WP_LANG_DIR . '/taskbuilder/taskbuilder-' . $locale . '.mo' );
45 load_plugin_textdomain( 'taskbuilder', false, plugin_basename( dirname( __FILE__ ) ) . '/lang' );
46 }
47
48 public function includes() {
49 include_once( WPPM_ABSPATH . 'includes/wppm-install.php' );
50 include_once( WPPM_ABSPATH . 'includes/class-wppm-functions.php' );
51 include( WPPM_ABSPATH.'includes/wppm_cron.php' );
52 include_once( WPPM_ABSPATH . 'includes/wppm_actions.php' );
53 if ($this->is_request('admin')) {
54 include_once( WPPM_ABSPATH . 'includes/class-wppm-admin.php' );
55 }
56 if ($this->is_request('frontend')) {
57 include_once( WPPM_ABSPATH . 'includes/class-wppm-frontend.php' );
58 }
59 if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
60 include_once( WPPM_ABSPATH . 'includes/EDD_SL_Plugin_Updater.php' );
61 }
62
63 }
64
65 public function define($name, $value) {
66 if (!defined($name)) {
67 define($name, $value);
68 }
69 }
70
71 public function is_request($type) {
72 switch ($type) {
73 case 'admin' :
74 return is_admin();
75 case 'frontend' :
76 return (!is_admin() || defined('DOING_AJAX') ) && !defined('DOING_CRON');
77 }
78 }
79
80 public function wppm_check_download_file(){
81 global $wpdb,$wppmfunction;
82 if( isset($_REQUEST['wppm_attachment']) && isset($_REQUEST['tid']) && isset($_REQUEST['tac'])){
83 $attach_id = intval(sanitize_text_field($_REQUEST['wppm_attachment']));
84 $auth_code = (sanitize_text_field($_REQUEST['tac']));
85 $task_id = intval(sanitize_text_field($_REQUEST['tid']));
86 $task_auth_code = $wppmfunction->get_task_fields($task_id,'task_auth_code');
87 $task_auth_code = sanitize_text_field($task_auth_code);
88 if($task_auth_code == $auth_code){
89 $this->wppm_file_download($attach_id);
90 }
91 }
92 if( isset($_REQUEST['wppm_attachment']) && isset($_REQUEST['pid']) && isset($_REQUEST['pac'])){
93 $attach_id = intval(sanitize_text_field($_REQUEST['wppm_attachment']));
94 $auth_code = (sanitize_text_field($_REQUEST['pac']));
95 $proj_id = intval(sanitize_text_field($_REQUEST['pid']));
96 $proj_auth_code = $wppmfunction->get_project_meta($proj_id,'project_auth_code',true);
97 $proj_auth_code = sanitize_text_field($proj_auth_code);
98 if($proj_auth_code == $auth_code){
99 $this->wppm_file_download($attach_id);
100 }
101 }
102 }
103
104 public function wppm_file_download($attach_id){
105 include WPPM_ABSPATH.'includes/admin/attachment/wppm_download_attachment.php';
106 }
107
108 public function deactivate() {
109 // Remove cron jobs
110 WPPMCron::wppm_unschedule_events();
111 }
112
113 }
114
115 endif;
116
117 new WP_Taskbuilder();
118