Skip to content

Commit

Permalink
Sync with the latest version of plugin
Browse files Browse the repository at this point in the history
= 0.9.1.1 =

Added Telangana state

= 0.9.1 =

Removed Deprecated PHP methods
Removed Deprecated Wordpress methods
Verified compatibility with latest version
Other bug fixes

= 0.9 =

Move the static fields to Dynamic fields and configure as needed
Workaround to fix content being displayed twice when used with some incompatible plugins and themes
Added restrcition for test pages - only admins can view
Some XSS attach vulnarability fixes
File upload size defaulted to php.ini
Added QR code base files for future support
Lot of bug fixes
UI optimizations
Remove unwanted logs
Updated the text-domain for the plugin and updated POT files
Added customized email method to track email notification failures
New design for Edit profile and Update profile screens - only if static filed are migrated
Email notifiation on Role change
removed Deprecated PHP methods
  • Loading branch information
prakashm88 committed Jul 7, 2018
1 parent 8cd925d commit 5b0b7fd
Show file tree
Hide file tree
Showing 23 changed files with 275 additions and 63 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.settings/
/.project
/.vs/slnx.sqlite
/.vs/genie-wp-matrimony/v15/.suo
/.vs/slnx.sqlite-journal
14 changes: 8 additions & 6 deletions application/controllers/GenieWPMatrimonyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class GenieWPMatrimonyController {
protected $_isDynaMigrated;
protected $links;

function GenieWPMatrimonyController() {
function __construct() {
add_action('init', array (
& $this,
'gwpm_init'
Expand Down Expand Up @@ -94,11 +94,11 @@ function gwpm_init() {
global $wpdb;
$this->_matrimonyPageId = $wpdb->get_var($wpdb->prepare("select post_id from $wpdb->postmeta where meta_key = '%s'", GWPM_META_KEY));
$this->_userLoginPreference = get_option( GWPM_USER_LOGIN_PREF );
$this->$_isDynaMigrated = get_option( GWPM_DYNA_FIELD_MIG_COMPLETE );
if (!isset($this->$_isDynaMigrated) || $this->$_isDynaMigrated == null) {
$this->$_isDynaMigrated = false;
$this->_isDynaMigrated = get_option( GWPM_DYNA_FIELD_MIG_COMPLETE );
if (!isset($this->_isDynaMigrated) || $this->_isDynaMigrated == null) {
$this->_isDynaMigrated = false;
}
$this->$_isDynaMigrated = false;
// $this->$_isDynaMigrated = false;
}

function gwpm_admin_header() {
Expand Down Expand Up @@ -308,7 +308,7 @@ function gwpm_get_links() {
}

function gwpm_admin_page_profiles() {
if ( $this->$_isDynaMigrated ) {
if ( $this->_isDynaMigrated ) {
include (GWPM_APPLICATION_URL . DS . 'views' . DS . 'gwpm_ctrl_profile_new.php');
} else {
include (GWPM_APPLICATION_URL . DS . 'views' . DS . 'gwpm_ctrl_profile.php');
Expand Down Expand Up @@ -404,6 +404,8 @@ function page_route($content) {

$pages_to_view = "NONE" ;
$controller = null ;

$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);

if (isset ($_GET['page'])) {
$controller = $_GET['page'];
Expand Down
3 changes: 2 additions & 1 deletion application/models/GwpmAdminModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ function migrateToDynamicFieldData() {

global $wpdb ;

$resultList = array ();

echo "<br /><br />Starting Process <br />" ;
$dynaFields = get_option('gwpm_dyna_mig_opts_field') ;

Expand Down Expand Up @@ -205,7 +207,6 @@ function migrateToDynamicFieldData() {
$result = $wpdb->get_results($preparedSql) ;

if (isset ($result) && $result != null && sizeof($result) != 0 ) {
$resultList = array ();

$processCount = 0 ;

Expand Down
8 changes: 4 additions & 4 deletions application/models/GwpmSearchModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,16 @@ function searchUsers($searchObj) {

if(isset($searchObj->gwpm_education)) {
$gwpm_education = $searchObj->gwpm_education ;
if ( !isNull($gwpm_education[qualification] )) {
if ( isset($gwpm_education['qualification']) && !isNull($gwpm_education['qualification'] )) {
$args = array ();
$filter = "meta_key = 'gwpm_education' AND meta_value LIKE %s" ;
$args[0] = '%s:13:"qualification";s:1:"' . like_escape($gwpm_education[qualification]) . '"%' ;
$args[0] = '%s:13:"qualification";s:1:"' . like_escape($gwpm_education['qualification']) . '"%' ;
$userLists = $this->getUserIds($searchFilterOption, $filter, $args, $userLists, $wpdb) ;
}
if ( !isNull($gwpm_education[status] )) {
if ( isset($gwpm_education['status']) && !isNull($gwpm_education['status'] )) {
$args = array ();
$filter = "meta_key = 'gwpm_education' AND meta_value LIKE %s" ;
$args[0] = '%s:6:"status";s:1:"' . like_escape($gwpm_education[status]) . '"%' ;
$args[0] = '%s:6:"status";s:1:"' . like_escape($gwpm_education['status']) . '"%' ;
$userLists = $this->getUserIds($searchFilterOption, $filter, $args, $userLists, $wpdb) ;
}
}
Expand Down
10 changes: 7 additions & 3 deletions application/views/admin/gwpm_ctrl_admin_dyna_fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
}

$deletedItems = "" ;
$formSubmitted = $_POST['formSubmitted'] ;
$formSubmitted = null ;
if (isset($_POST['formSubmitted'] )) {
$formSubmitted = $_POST['formSubmitted'] ;
}

if($formSubmitted != null) {

Expand Down Expand Up @@ -48,10 +51,11 @@ class="gwpm_message_box"></div>
method="post">
<div id="oldDynamicFieldHolder">
<?php
$totalFields = $existingRecords ;
$itrTotalFields = $existingRecords ;
$displayText = "" ;
$alternateClass = "" ;
for(;$totalFields > 0; $totalFields-- ) {
//for(;$totalFields > 0; $totalFields-- ) {
for ($totalFields =1; $totalFields <= $itrTotalFields ; $totalFields++ ) {
$fetched_options = get_option(GWPM_DYNA_KEY_PREFIX . $totalFields) ;
if(isset($fetched_options) && $fetched_options != null ) {

Expand Down
6 changes: 3 additions & 3 deletions application/views/admin/gwpm_ctrl_admin_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<tr><td>
<?php if(GWPM_ENABLE_DEBUGGING == true) {?>
<p><?php _e("Developer mode enabled: ", 'genie-wp-matrimony'); ?></p></td><td>
Logger Location: <?php echo getLogDir(); ?>
Logger Location: <?php echo getLogDir() . '<br />' . 'Max file upload allowed: '. gwpmGetMaxFileUploadSize(); ?>
</td></tr>
<?php } ?>
<tr><td><p><?php _e("Frequently Asked Questions (FAQs)", 'genie-wp-matrimony'); ?></p></td><td>
<!-- <tr><td><p><?php _e("Frequently Asked Questions (FAQs)", 'genie-wp-matrimony'); ?></p></td><td>
<ol>
<li><?php _e("Register option not found?", 'genie-wp-matrimony'); ?><br /> <a target="_blank" href="<?php echo get_admin_url() . 'options-general.php#users_can_register' ?>"><?php _e("Click here to enable Registration", 'genie-wp-matrimony'); ?></a></li>
<li><?php _e("Search result not displaying user picture?", 'genie-wp-matrimony'); ?><br /> <a target="_blank" href="<?php echo get_admin_url() . 'options-discussion.php#show_avatars' ?>"><?php _e("Click here to check Default Avatar Options", 'genie-wp-matrimony'); ?></a></li>
Expand All @@ -55,7 +55,7 @@
echo "<br /> ";
_e("Please report back with the incompatible theme/plugin for fixes", 'genie-wp-matrimony');
?> </li>
</ol> </td></tr>
</ol> </td></tr> -->
</table>
<?php
if(isset($urlId)) {
Expand Down
17 changes: 14 additions & 3 deletions application/views/admin/gwpm_ctrl_admin_statdyna.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
_e("Migration of fields already done !", 'genie-wp-matrimony') ;
echo "<br /><br />" ;
} else {
$formSubmitted = $_POST['formSubmitted'];
$formSubmitted = null ;
if (isset($_POST['formSubmitted'] )) {
$formSubmitted = $_POST['formSubmitted'] ;
}
?>

<form name="gwpm_form" method="post"
Expand All @@ -30,8 +33,16 @@
<?php
if (isset($formSubmitted) && $formSubmitted != null) {

$createFields = $_POST['createFields'];
$migrateFields = $_POST['migrateFields'];
$createFields = null ;
$migrateFields = null ;

if (isset($_POST['createFields'] )) {
$createFields= $_POST['createFields'] ;
}

if (isset($_POST['migrateFields'] )) {
$migrateFields= $_POST['migrateFields'] ;
}

if (isset($createFields) && $createFields != null) {

Expand Down
67 changes: 64 additions & 3 deletions application/views/gwpm_ctrl_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

global $wpdb;
global $matrimonyPostId;
screen_icon();
//screen_icon();
echo "<h2>" . __('Genie WP Matrimony Configuration', 'genie-wp-matrimony') . "</h2>";

if( isset( $_GET[ 'tab' ] ) ) {
Expand Down Expand Up @@ -43,9 +43,17 @@

appendLog("admin ctrl page: setupStatus " . $setupStatus) ;

$resultObj[0] = "";
$resultObj[1] = "";
$resultObj[2] = "";
$resultObj[3] = "";
$resultObj[4] = "";
$resultObj[5] = "";
$resultObj[6] = "";

if ($setupStatus) {
$resultObj[0] = "selected";
$resultObj[1] = "";
$resultObj[0] = "selected";
$resultObj[2] = "selected";
$resultObj[4] = "checked='checked'";
$user_pref = get_option(GWPM_USER_LOGIN_PREF) ;
Expand All @@ -64,7 +72,7 @@
}

?>
<div id="icon-themes" class="icon32"></div>
<div id="icon-themes" class="icon32"></div>
<h2 class="nav-tab-wrapper">
<a href="?page=gwpma&tab=main_options" class="nav-tab <?php echo $active_tab == 'main_options' ? 'nav-tab-active' : ''; ?>" >General Options</a>
<a href="<?php echo $dynaTabUrl ; ?>" class="nav-tab <?php echo $active_tab == 'dyna_options' ? 'nav-tab-active' : ''; ?>" >Dynamic Fields</a>
Expand All @@ -74,6 +82,37 @@

<div class="current-theme-new">

<button type="button" id="gwpm-faq-expander-id" class="gwpm-expander-header" >
<span class="dashicons-before dashicons-editor-help">Frequently Asked Questions (FAQs)</span>
<span id="gwpm-arrow-holder-id" class="dashicons dashicons-arrow-down"></span>
</button>
<div class="gwpm-seperator">
<div id="gwpm-faqs-container-id" class="gwpm-faqs-container hidden">
<ol>
<li><strong><?php _e("Register option not found?", 'genie-wp-matrimony'); ?></strong><br /> <a target="_blank" href="<?php echo get_admin_url() . 'options-general.php#users_can_register' ?>"><?php _e("Click here to enable Registration", 'genie-wp-matrimony'); ?></a></li>
<li><strong><?php _e("Search result not displaying user picture?", 'genie-wp-matrimony'); ?></strong><br /> <a target="_blank" href="<?php echo get_admin_url() . 'options-discussion.php#show_avatars' ?>"><?php _e("Click here to check Default Avatar Options", 'genie-wp-matrimony'); ?></a></li>
<li><strong><?php _e("Matrimonial menu not found?", 'genie-wp-matrimony'); ?></strong><br /> <a target="_blank" href="<?php echo get_admin_url() . 'nav-menus.php' ?>"><?php _e("Click here to Manage your Menu items", 'genie-wp-matrimony'); ?></a></li>
<li><strong><?php _e("How to approve users?", 'genie-wp-matrimony'); ?></strong><br /> <a target="_blank" href="<?php echo get_admin_url() . 'admin.php?page=gpwmp_admin' ?>"><?php _e("Click here to Manage users", 'genie-wp-matrimony'); ?></a></li>
<li><strong><?php _e("How to change file upload size?", 'genie-wp-matrimony'); ?></strong><br /><?php _e("File upload size is defaulted based on the php.ini settings", 'genie-wp-matrimony'); ?></li>
<li><strong><?php _e("User not found in search?", 'genie-wp-matrimony'); ?></strong><br />
<?php
_e("Administrators wont be shown in search results");
echo "<br /> ";
_e("Create a new profile with Role 'Matrimony User' and try searching.", 'genie-wp-matrimony'); ?>
</li>
<li><strong><?php
_e("Matrimonial pages display data more than once?", 'genie-wp-matrimony');
echo "</strong><br /> ";
_e("The problem might be because of the theme used or a conflicting plugin", 'genie-wp-matrimony');
echo "<br /> ";
_e("Try to change the theme to Wordpress default or disable other plugins and test", 'genie-wp-matrimony');
echo "<br /> ";
_e("Please report back with the incompatible theme/plugin for fixes if any", 'genie-wp-matrimony');
?> </li>
<li><strong><?php _e("Have more clarifications?", 'genie-wp-matrimony'); ?></strong><br /> <a target="_blank" href="http://itechgenie.com/myblog/genie-wp-matrimony/"><?php _e("Get Support", 'genie-wp-matrimony'); ?></a></li>
</ol>
</div> </div>

<?php

if($active_tab == "main_options") {
Expand All @@ -88,4 +127,26 @@
?>
</div>

<script type="text/javascript">

var isExpanded = false ;

jQuery(document).ready(function() {
jQuery("#gwpm-faq-expander-id").live("click", function(obj){
if (isExpanded) {
jQuery("#gwpm-arrow-holder-id").removeClass("dashicons-arrow-up");
jQuery("#gwpm-arrow-holder-id").addClass("dashicons-arrow-down");
isExpanded = false ;
jQuery("#gwpm-faqs-container-id").slideUp() ;
} else {
jQuery("#gwpm-arrow-holder-id").removeClass("dashicons-arrow-down");
jQuery("#gwpm-arrow-holder-id").addClass("dashicons-arrow-up");
isExpanded = true ;
jQuery("#gwpm-faqs-container-id").slideDown() ;
}
}) ;
});

</script>

</div>
2 changes: 1 addition & 1 deletion application/views/gwpm_ctrl_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function gwpm_admin_dasboard_page_all_users() {
?>
<div id="gwpm_admin_dashboard" class="wrap">
<?php
screen_icon('options-general');
//screen_icon('options-general');
echo "<h2>" . __( 'Admin Dashboard', 'genie-wp-matrimony' ) . "</h2>" ;
?>
<div id="poststuff" class="metabox-holder">
Expand Down
2 changes: 1 addition & 1 deletion application/views/gwpm_ctrl_profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="wrap">
<?php

screen_icon('options-general');
//screen_icon('options-general');
echo "<h2>" . __( 'Matrimonial Profile', 'genie-wp-matrimony' ) . "</h2>" ;
try {
$profileModel = new GwpmProfileModel() ;
Expand Down
2 changes: 1 addition & 1 deletion application/views/gwpm_ctrl_profile_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="wrap">
<?php

screen_icon('options-general');
//screen_icon('options-general');
echo "<h2>" . __( 'Matrimonial Profile', 'genie-wp-matrimony' ) . "</h2>" ;
try {
$profileModel = new GwpmProfileModel() ;
Expand Down
2 changes: 1 addition & 1 deletion application/views/profile/gwpm_pg_edit_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class="gwpm-datepicker"
<td valign="top"><?php _e('Profile Photo', 'genie-wp-matrimony') ?>:</td>
<td valign="top">
<input type="file" name="gwpm_profile_photo" id="gwpm_profile_photo" /> <br />
<span class="gwpm-help" >Image maximum size <b>500</b> kb </span>
<span class="gwpm-help" >Image maximum size <?php echo gwpmGetMaxFileUploadSize(); ?></span>
</tr>
</tbody>
</table>
Expand Down
8 changes: 4 additions & 4 deletions application/views/profile/gwpm_pg_edit_old.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class="gwpm-datepicker"
$totalDynamicFields = $dynaData['gwpm_dynamic_field_count'] ;
$dyna_field_item = $dynaData['dyna_field_item'] ;

if(sizeof($dyna_field_item) > 0) {
if(isset($dyna_field_item) && sizeof($dyna_field_item) > 0) {
?>
<h3>
<a href="#"><?php _e('Other Information', 'genie-wp-matrimony') ?></a> <?php _e("(Enter 'NA' if Not Applicable)", 'genie-wp-matrimony') ?>
Expand Down Expand Up @@ -276,8 +276,8 @@ class="gwpm-datepicker"
<tr>
<td valign="top"><?php _e('Profile Photo', 'genie-wp-matrimony') ?>:</td>
<td valign="top">
<input type="file" name="gwpm_profile_photo" id="gwpm_profile_photo" /> </ br>
<span class="gwpm-help" >Image maximum size <b>500</b> kb </span>
<input type="file" name="gwpm_profile_photo" id="gwpm_profile_photo" /> <br />
<span class="gwpm-help" >Image maximum size <?php echo gwpmGetMaxFileUploadSize(); ?></span>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -305,7 +305,7 @@ class="gwpm-datepicker"
var month = today.getMonth() ;
jQuery("#gwpm_dob").datetimepicker({ ampm: true, maxDate: new Date(year, month, 1) });
// jQuery("#gwpm_tmasvs_reg_date").datepicker({ dateFormat: 'MM d, yy', changeMonth: true, changeYear: true, firstDay: 0, monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'], dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], isRTL: false, minDate: '-100y', maxDate: '+5y', yearRange: '-100y:+5y' });
jQuery("#gwpm_accordion").accordion({ autoHeight: false, collapsible: true, active: -1 });
// jQuery("#gwpm_accordion").accordion({ autoHeight: false, collapsible: true, active: -1 });
jQuery("select").change(function(obj){
if(obj.currentTarget.id == "gwpm_education[qualification]" && obj.currentTarget.value == 7) {
jQuery("#gwpm_education_other").removeClass("gwpm_hidden_fields");
Expand Down
2 changes: 1 addition & 1 deletion application/views/profile/gwpm_pg_view_old.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class="gwpm_profile_pic" alt="profile-picture"
$totalDynamicFields = $dynaData['gwpm_dynamic_field_count'] ;
$dyna_field_item = $dynaData['dyna_field_item'] ;

if(sizeof($dyna_field_item) > 0) {
if(isset($dyna_field_item) && sizeof($dyna_field_item) > 0) {
?>
<tr>
<td colspan="2">
Expand Down
2 changes: 1 addition & 1 deletion application/vos/GwpmGalleryVO.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GwpmGalleryVO extends GwpmCommand {
var $gwpm_gallery_img;
var $max_id ;

function GwpmGalleryVO(){
function __construct(){

}
}
2 changes: 1 addition & 1 deletion config/gwpm_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
define('GWPM_USER_PREFIX', 'gwpm_');
define('GWPM_GALLERY_DIR', WP_CONTENT_DIR . URL_S . 'uploads' . URL_S . 'gwpm_gallery');
define('GWPM_GALLERY_URL', WP_CONTENT_URL . URL_S . 'uploads' . URL_S . 'gwpm_gallery');
define("GWPM_IMAGE_MAX_SIZE", "2048"); // In KBs
// define("GWPM_IMAGE_MAX_SIZE", "2048"); // In KBs
define("GWPM_GALLERY_MAX_IMAGES", "12");
define("GWPM_CONVERSE_MAX_NOS", "10");
define("GWPM_ACTIVITY_MAX_NOS", "10");
Expand Down
4 changes: 2 additions & 2 deletions genie-wp-matrimony-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Version: 0.9
Author: prakashm88
Author URI: http://www.itechgenie.com
License: GPLv2
License: GPLv2 or later
Text Domain: genie-wp-matrimony
*/

Expand Down Expand Up @@ -97,7 +97,7 @@
}

if (class_exists('GenieWPMatrimonyController') && !$genieWPMatrimonyController) {
$genieWPMatrimonyController = new GenieWPMatrimonyController();
$genieWPMatrimonyController = new GenieWPMatrimonyController();
}

if(class_exists('GwpmActivityModel') && !$gwpm_activity_model) {
Expand Down
Loading

0 comments on commit 5b0b7fd

Please sign in to comment.