Skip to content

Commit

Permalink
int 1.4.4
Browse files Browse the repository at this point in the history
## [1.4.4]

### Stable - Security Release
- Update Educare to v1.4.4 (and above): Please make sure to update your Educare plugin to version 1.4.4 or higher as soon as possible.
- Added nonce to improve form security.
- Fixed Cross Site Request Forgery (CSRF) issues.
- Removed unnecessary code to enhance performance and security.
- Eliminated inline JavaScript to improve security measures.
- Addressed well-known bugs to ensure smoother functionality.

**Notes:** Update includes security improvements and bug fixes: The latest version of Educare comes with important security enhancements and fixes for any known issues. Please update to this version to ensure a safer and smoother experience with the plugin. Sometimes users may need to clear browsing data to load the updated script correctly.
  • Loading branch information
R-Atik authored Jul 29, 2023
1 parent 2c5ab52 commit 3e868f4
Show file tree
Hide file tree
Showing 23 changed files with 2,542 additions and 1,918 deletions.
89 changes: 58 additions & 31 deletions Educare.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package Educare
* @version 1.4.3
* @version 1.4.4
* @author FixBD <fixbd.org@gmail.com>
* @copyright GPL-2.0+
* @link http://github.com/fixbd/educare
Expand All @@ -10,7 +10,7 @@
* Plugin Name: Educare
* Plugin URI: http://github.com/fixbd/educare
* Description: Educare is a powerful online School/College students & results management system dev by FixBD. This plugin allows you to manage and publish students results. You can easily Add/Edit/Delete Students, Results, Class, Exam, Year Custom field and much more... Also you can import & export unlimited students and results just a click!
* Version: 1.4.3
* Version: 1.4.4
* Author: FixBD
* Author URI: http://github.com/fixbd
* License: GPL-2.0+
Expand All @@ -25,23 +25,42 @@
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>.
*
*/

// Make it simple! (Define paths)
// You can use ### include "your/url/files.php";
define('EDUCARE_VERSION', '1.4.3');
define('EDUCARE_SETTINGS_VERSION', '1.0');
define('EDUCARE_RESULTS_VERSION', '1.0');
define('EDUCARE_DIR', plugin_dir_path(__FILE__));
define('EDUCARE_INC', EDUCARE_DIR.'includes'.'/');
define('EDUCARE_ADMIN', EDUCARE_INC.'admin'.'/');
define('EDUCARE_TEMP', EDUCARE_DIR.'templates'.'/');
define('EDUCARE_FOLDER', basename(dirname(__FILE__)));
define('EDUCARE_URL', plugin_dir_url(EDUCARE_FOLDER).EDUCARE_FOLDER.'/');
// Prevent direct access to the file
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly
}


if ( ! defined( 'EDUCARE_VERSION' ) ) {
/**
* Plugin Name-Space For Educare.
*
* @since 1.2.0
*
*/

// Make it simple! (Define Educare Name-Space)
// Plugin Version
define('EDUCARE_VERSION', '1.4.4');
// Settings Version
define('EDUCARE_SETTINGS_VERSION', '1.0');
define('EDUCARE_RESULTS_VERSION', '1.0');
// Educare Dir Path
define('EDUCARE_DIR', plugin_dir_path(__FILE__));
define('EDUCARE_INC', EDUCARE_DIR.'includes'.'/');
define('EDUCARE_ADMIN', EDUCARE_INC.'admin'.'/');
define('EDUCARE_TEMP', EDUCARE_DIR.'templates'.'/');
define('EDUCARE_FOLDER', basename(dirname(__FILE__)));
define('EDUCARE_URL', plugin_dir_url(EDUCARE_FOLDER).EDUCARE_FOLDER.'/');
}

// Create a database table for plugin settings and student results system
require_once(EDUCARE_INC.'database/educare-database.php');
// Active action

// Activation action
register_activation_hook( __FILE__, 'educare_database_table' );
// Uninstall action
register_uninstall_hook( __FILE__, 'educare_uninstall_action' );
Expand All @@ -55,45 +74,53 @@


/**
* ### function for add menu when active educare
*
* @since 1.0.0
* @last-update 1.4.2
*
* @param [type] $links
* @param [type] $file
* @return void
* Adds custom action links to the plugin entry in the WordPress admin dashboard.
*
* This function is used to modify the action links displayed for the plugin in the
* list of installed plugins in the WordPress admin dashboard. The action links provide
* quick access to specific pages or actions related to the plugin.
*
* @param array $links An array of existing action links for the plugin.
* @param string $file The main file of the current plugin.
* @return array Modified array of action links.
*/

if (!function_exists('educare_action_links')) {
function educare_action_links( $links, $file ) {
function educare_action_links($links, $file) {
// Declare a static variable to store the plugin's main file name.
static $educare;


// Get the plugin's main file name using plugin_basename function.
if (!$educare) {
$educare = plugin_basename(__FILE__);
}

$action_links = array (
// 'link' => 'titile',
// Define the custom action links to be added.
$action_links = array(
'settings' => 'Settings',
'management' => 'Management',
'all-results' => 'All Results',
'all-students' => 'All Students'
);

// Loop through each custom action link and add it to the $links array.
foreach ($action_links as $url => $title) {
// Check if the current plugin file matches the plugin's main file.
if ($file == $educare) {
$in = '<a href="admin.php?page=educare-'.esc_attr($url).'">' . __(esc_html($title),'educare') . '</a>';
// Create the HTML link with the appropriate URL and title.
$in = '<a href="' . esc_url('admin.php?page=educare-'.$url) . '">' . esc_html($title) . '</a>';
// Add the custom action link to the beginning of the $links array.
array_unshift($links, $in);
}
}
}

// Return the modified array of action links.
return $links;
}

// add options after plugin activation
add_filter( 'plugin_action_links', 'educare_action_links', 10, 2 );
// Add the 'educare_action_links' function as a filter to modify plugin action links.
add_filter('plugin_action_links', 'educare_action_links', 10, 2);
}



?>
8 changes: 8 additions & 0 deletions assets/css/educare.css
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ h2.left {
padding: 1rem;
}

.educare_data_field {
display: none !important;
}

.educare-settings {
display: flex;
margin: 0;
Expand Down Expand Up @@ -1097,6 +1101,10 @@ p #help:hover {
vertical-align: middle;
}

.action_menu .button {
display: inline-block !important;
}

.action_menu .action_link::after {
content: "";
position: absolute;
Expand Down
57 changes: 57 additions & 0 deletions assets/js/educare-wp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Educare functionality only (mainly for ajax)
*
* Autor: FixBD
* Autor Link: https://fixbd.net
* Source: https://github.com/fixbd/educare/assets/js/educare.js
*
*/

// jQuery
// Front-End Results System
jQuery(document).ready(function($) {
// Ajax functionality for educare_results shortcode
$(document).on("click", "#results_btn", function(event) {
event.preventDefault();
$(this).attr('disabled', true);
var current = $(this);
var form_data = $(this).parents('form').serialize();

$.ajax({
url: educareAjax.url,
type: 'POST',
data: {
action: 'educare_proccess_view_results',
nonce: educareAjax.nonce,
form_data: form_data
},
beforeSend: function(event) {
$('#educare-loading').fadeIn();
},
success: function(data) {
if (data.message) {
var arr;

if (data.message == 'Result not found. Please try again') {
arr = 'success'
} else {
arr = 'error';
}

$('#msgs').html('<div class="results_form error_notice ' + arr + '">' + data.message) + '</div>';
} else {
$('#educare-results-body').html(data);
}

},
error: function(data) {
$('#educare-results-body').html(data + '<div class="notice notice-error is-dismissible"><p>Sorry, database connection error!</p></div>');
},
complete: function() {
current.prop('disabled', false);
$('#educare-loading').fadeOut();
grecaptcha.reset();
}
});
});
});
Loading

0 comments on commit 3e868f4

Please sign in to comment.