PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 5.0.2
Taskbuilder – Project Management & Task Management Tool With Kanban Board v5.0.2
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 5.0.2, at taskbuilder.php

119 lines 4.3 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://taskbuilder.net/
5 * Description: Wordpress Project Management & Task Management plugin. Easy to keep track of projects & tasks!
6 * Version: 5.0.2
7 * Author: Taskbuilder Team
8 * Author URI: https://taskbuilder.net/
9 * Requires at least: 4.4
10 * Tested up to: 6.9
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 = '5.0.2';
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 include_once( WPPM_ABSPATH . 'includes/class-wppm-profile-update.php' );
56 }
57 if ($this->is_request('frontend')) {
58 include_once( WPPM_ABSPATH . 'includes/class-wppm-frontend.php' );
59 }
60 if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
61 include_once( WPPM_ABSPATH . 'includes/EDD_SL_Plugin_Updater.php' );
62 }
63
64 }
65
66 public function define($name, $value) {
67 if (!defined($name)) {
68 define($name, $value);
69 }
70 }
71
72 public function is_request($type) {
73 switch ($type) {
74 case 'admin' :
75 return is_admin();
76 case 'frontend' :
77 return (!is_admin() || defined('DOING_AJAX') ) && !defined('DOING_CRON');
78 }
79 }
80
81 public function wppm_check_download_file(){
82 global $wpdb,$wppmfunction;
83 if( isset($_REQUEST['wppm_attachment']) && isset($_REQUEST['tid']) && isset($_REQUEST['tac'])){
84 $attach_id = intval(sanitize_text_field($_REQUEST['wppm_attachment']));
85 $auth_code = (sanitize_text_field($_REQUEST['tac']));
86 $task_id = intval(sanitize_text_field($_REQUEST['tid']));
87 $task_auth_code = $wppmfunction->get_task_fields($task_id,'task_auth_code');
88 $task_auth_code = sanitize_text_field($task_auth_code);
89 if($task_auth_code == $auth_code){
90 $this->wppm_file_download($attach_id);
91 }
92 }
93 if( isset($_REQUEST['wppm_attachment']) && isset($_REQUEST['pid']) && isset($_REQUEST['pac'])){
94 $attach_id = intval(sanitize_text_field($_REQUEST['wppm_attachment']));
95 $auth_code = (sanitize_text_field($_REQUEST['pac']));
96 $proj_id = intval(sanitize_text_field($_REQUEST['pid']));
97 $proj_auth_code = $wppmfunction->get_project_meta($proj_id,'project_auth_code',true);
98 $proj_auth_code = sanitize_text_field($proj_auth_code);
99 if($proj_auth_code == $auth_code){
100 $this->wppm_file_download($attach_id);
101 }
102 }
103 }
104
105 public function wppm_file_download($attach_id){
106 include WPPM_ABSPATH.'includes/admin/attachment/wppm_download_attachment.php';
107 }
108
109 public function deactivate() {
110 // Remove cron jobs
111 WPPMCron::wppm_unschedule_events();
112 }
113
114 }
115
116 endif;
117
118 new WP_Taskbuilder();
119