Skip to content

Commit

Permalink
Merge pull request #63 from ahmedkaludi/2.4.6
Browse files Browse the repository at this point in the history
2.4.6
  • Loading branch information
shridhamdeveloper committed Apr 17, 2024
2 parents 36454d9 + 9cc54bc commit 85005a9
Show file tree
Hide file tree
Showing 21 changed files with 590 additions and 41 deletions.
81 changes: 81 additions & 0 deletions assets/scripts/wpm-feedback-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
var strict;

jQuery(document).ready(function ($) {
/**
* DEACTIVATION FEEDBACK FORM
*/
// show overlay when clicked on "deactivate"
wpm_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="wp-multilang"] .row-actions .deactivate a');
wpm_deactivate_link_url = wpm_deactivate_link.attr('href');

wpm_deactivate_link.click(function (e) {
e.preventDefault();
// only show feedback form once per 30 days
var c_value = wpm_admin_get_cookie("wpm_hide_deactivate_feedback");

if (c_value === undefined) {
$('#wpm-reloaded-feedback-overlay').show();
} else {
// click on the link
window.location.href = wpm_deactivate_link_url;
}
});
// show text fields
$('#wpm-reloaded-feedback-content input[type="radio"]').click(function () {
// show text field if there is one
var inputValue = $(this).attr("value");
var targetBox = $("." + inputValue);
$(".mb-box").not(targetBox).hide();
$(targetBox).show();
});
// send form or close it
$('#wpm-reloaded-feedback-content .button').click(function (e) {
e.preventDefault();
// set cookie for 30 days
var exdate = new Date();
exdate.setSeconds(exdate.getSeconds() + 2592000);
document.cookie = "wpm_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";

$('#wpm-reloaded-feedback-overlay').hide();
if ('wpm-reloaded-feedback-submit' === this.id) {
// Send form data
$.ajax({
type: 'POST',
url: ajaxurl,
dataType: 'json',
data: {
action: 'wpm_send_feedback',
data: $('#wpm-reloaded-feedback-content form').serialize()
},
complete: function (MLHttpRequest, textStatus, errorThrown) {
// deactivate the plugin and close the popup
$('#wpm-reloaded-feedback-overlay').remove();
window.location.href = wpm_deactivate_link_url;

}
});
} else {
$('#wpm-reloaded-feedback-overlay').remove();
window.location.href = wpm_deactivate_link_url;
}
});
// close form without doing anything
$('.wpm-feedback-not-deactivate').click(function (e) {
$('#wpm-reloaded-feedback-overlay').hide();
});

function wpm_admin_get_cookie (name) {
var i, x, y, wpm_cookies = document.cookie.split( ";" );
for (i = 0; i < wpm_cookies.length; i++)
{
x = wpm_cookies[i].substr( 0, wpm_cookies[i].indexOf( "=" ) );
y = wpm_cookies[i].substr( wpm_cookies[i].indexOf( "=" ) + 1 );
x = x.replace( /^\s+|\s+$/g, "" );
if (x === name)
{
return unescape( y );
}
}
}

}); // document ready
1 change: 1 addition & 0 deletions assets/scripts/wpm-feedback-script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions assets/styles/admin/wpm-feedback-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* makebetter admin css*/

/**
PLUGINS ADMIN PAGE
*/
#wpm-reloaded-feedback-overlay {
/* Height & width depends on how you want to reveal the overlay (see JS below) */
height: 100%;
width: 100%;
position: fixed; /* Stay in place */
z-index: 10000; /* Sit on top */
left: 0;
top: 0;
background-color: rgb(120,120,120); /* Black fallback color */
background-color: rgba(0,0,0, 0.5); /* Black w/opacity */
}
#wpm-reloaded-feedback-content {
position: relative;
top: 25%; /* 25% from the top */
width: 500px;
max-width: 100%;
margin: auto;
margin-top: 30px; /* 30px top margin to avoid conflict with the close button on smaller screens */
max-height: 50%;
padding: 20px;
background-color: #fff;
overflow-y: auto;
}
.mb-box{display: none;width:100%;}
.wpm-feedback-not-deactivate { display: block; text-align: right; }

#wpm-reloaded-feedback-content h3{
margin:5px;
font-size: 1em;
}

@media screen and (max-width:400px){
#wpm-reloaded-feedback-content {
padding:0px;
padding-bottom:50px;
}
}
1 change: 1 addition & 0 deletions assets/styles/admin/wpm-feedback-style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 22 additions & 11 deletions configs/plugins/woocommerce.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,53 +35,64 @@
"woocommerce_email_from_name": {},
"woocommerce_new_order_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_completed_order_settings": {
"subject" : {},
"heading" : {},
"subject_downloadable" : {},
"heading_downloadable" : {}
"heading_downloadable" : {},
"additional_content" : {}
},
"woocommerce_customer_invoice_settings": {
"subject" : {},
"heading" : {},
"subject_paid" : {},
"heading_paid" : {}
"heading_paid" : {},
"additional_content" : {}
},
"woocommerce_customer_new_account_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_note_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_reset_password_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_processing_order_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_cancelled_order_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_failed_order_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_on_hold_order_settings": {
"subject" : {},
"heading" : {}
"heading" : {},
"additional_content" : {}
},
"woocommerce_customer_refunded_order_settings": {
"subject_full" : {},
"heading_full" : {},
"subject_partial" : {},
"heading_partial" : {}
"heading_partial" : {},
"additional_content" : {}
},
"woocommerce_paypal_settings": {
"title" : {},
Expand Down
14 changes: 12 additions & 2 deletions configs/plugins/wordpress-seo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
"_yoast_wpseo_opengraph-title": {},
"_yoast_wpseo_opengraph-description": {},
"_yoast_wpseo_twitter-title": {},
"_yoast_wpseo_twitter-description": {}
"_yoast_wpseo_twitter-description": {},
"_yoast_wpseo_schema_page_type": {},
"_yoast_wpseo_schema_article_type": {},
"_yoast_wpseo_opengraph-image": {},
"_yoast_wpseo_opengraph-image-id": {},
"_yoast_wpseo_twitter-image": {},
"_yoast_wpseo_twitter-image-id": {}
},
"admin_pages": [
"seo_page_wpseo_titles",
Expand Down Expand Up @@ -56,7 +62,11 @@
"wpseo_opengraph-title" : {},
"wpseo_opengraph-description" : {},
"wpseo_twitter-title" : {},
"wpseo_twitter-description" : {}
"wpseo_twitter-description" : {},
"wpseo_opengraph-image" : {},
"wpseo_opengraph-image-id" : {},
"wpseo_twitter-image" : {},
"wpseo_twitter-image-id" : {}
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions includes/admin/class-wpm-admin-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ public function add_language_switcher() {
var toolbar = $('.edit-post-header-toolbar');
if(toolbar.length) {
toolbar.prepend(language_switcher);
} else {
window.setTimeout(wpm_add_language_switcher_deferred, 100);
}
}
wpm_add_language_switcher_deferred();
window.setTimeout(wpm_add_language_switcher_deferred, 500);
}
});
Expand Down
3 changes: 3 additions & 0 deletions includes/admin/class-wpm-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public static function get_settings_pages() {
$settings[] = new Settings\WPM_Settings_Languages();
$settings[] = new Settings\WPM_Settings_Additional();
$settings[] = new Settings\WPM_Settings_Support();
if(!defined('WP_MULTILANG_PRO_VERSION')){
$settings[] = new Settings\WPM_Settings_Upgrade_Pro();
}

self::$settings = apply_filters( 'wpm_get_settings_pages', $settings );
}
Expand Down
1 change: 1 addition & 0 deletions includes/admin/class-wpm-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function includes() {
new WPM_Admin_Widgets();
new WPM_Admin_Assets();
new WPM_Admin_Qtranslate();
new WPM_Deactivate_Feedback_Form();
}

/**
Expand Down
30 changes: 30 additions & 0 deletions includes/admin/settings/class-wpm-settings-upgradepro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* WP Multilang Additional Settings
*
* @category Admin
* @package WPM/Admin
* @author Magazine3
* @since 1.0
*/

namespace WPM\Includes\Admin\Settings;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

/**
* WPM_Settings_Upgrade_Pro.
*/
class WPM_Settings_Upgrade_Pro extends WPM_Settings_Page {
/**
* Constructor.
*/
public function __construct() {
$this->id = 'upgradetopro';
$this->label = __( 'Upgrade to Pro', 'wp-multilang' );

parent::__construct();
}
}

0 comments on commit 85005a9

Please sign in to comment.