Version Description
Download this release
Release Info
| Developer | wpkube |
| Plugin | |
| Version | 190325 |
| Comparing to | |
| See all releases | |
Code changes from version 190305 to 190325
- includes/js/admin/stcr_system.js +7 -92
- options/stcr_system.php +18 -47
- readme.txt +11 -17
- subscribe-to-comments-reloaded.php +1 -2
- templates/user.php +2 -2
- utils/stcr_manage.php +31 -0
- utils/stcr_upgrade.php +2 -12
- utils/stcr_utils.php +19 -14
- wp_subscribe_reloaded.php +29 -3
includes/js/admin/stcr_system.js
CHANGED
|
@@ -1,97 +1,12 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
*/
|
| 4 |
-
( function($){
|
| 5 |
-
$(document).ready(function(){
|
| 6 |
|
| 7 |
-
|
| 8 |
-
var download_report_btn = $('.download_report');
|
| 9 |
-
var spinner = $('.generate_spinner');
|
| 10 |
-
var reportPath_input = $('.reportPath');
|
| 11 |
-
var working_file_path = $('.file-path');
|
| 12 |
-
var download_report_error_container = $('.download_report_error');
|
| 13 |
-
var generate_system_info_btn = $('button.generate_system_info');
|
| 14 |
-
var reportData_txt = $(".reportData");
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
if( firstGeneration === true )
|
| 22 |
-
{
|
| 23 |
-
// Get request response
|
| 24 |
-
var reportPath = reportPath_input.val();
|
| 25 |
-
var result = reportPath.split( "|" );
|
| 26 |
-
var reportResult = result[0];
|
| 27 |
-
var reportValue = result[1];
|
| 28 |
-
var reportAdditionalInfo = result[2];
|
| 29 |
-
// check result true|false
|
| 30 |
-
if( reportResult == "true" )// if true add the path to the download link
|
| 31 |
-
{
|
| 32 |
-
// display download link
|
| 33 |
-
download_report_btn.prop("href", reportValue + "?name=systemInformation" );
|
| 34 |
-
download_report_btn.removeClass('stcr-hidden');
|
| 35 |
-
}
|
| 36 |
-
else if( reportResult == "false" ) // if false show a error message with the file permission issue.
|
| 37 |
-
{
|
| 38 |
-
working_file_path.text(reportAdditionalInfo);
|
| 39 |
-
// Bootstrap alert box
|
| 40 |
-
download_report_error_container.removeClass('stcr-hidden');
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
-
firstGeneration = false;
|
| 44 |
-
}
|
| 45 |
-
else if( firstGeneration === false )
|
| 46 |
-
{
|
| 47 |
-
var nonce = _this.data('nonce');
|
| 48 |
-
nonce = nonce.split('|');
|
| 49 |
-
var data = {
|
| 50 |
-
action: nonce[1],
|
| 51 |
-
security: nonce[0],
|
| 52 |
-
fileName: "systemInformation.txt",
|
| 53 |
-
fileData: "" + reportData_txt.val()
|
| 54 |
-
};
|
| 55 |
-
|
| 56 |
-
// Make the Ajax request.
|
| 57 |
-
$.ajax({
|
| 58 |
-
type: "post",
|
| 59 |
-
url: ajaxurl,
|
| 60 |
-
data: data,
|
| 61 |
-
beforeSend: function() {
|
| 62 |
-
spinner.removeClass('stcr-hidden');
|
| 63 |
-
},
|
| 64 |
-
success: function ( response ){
|
| 65 |
-
|
| 66 |
-
console.debug( response );
|
| 67 |
-
if ( response.success === true ) {
|
| 68 |
-
// check result true|false
|
| 69 |
-
if( response.data.result == "true" )// if true add the path to the download link
|
| 70 |
-
{
|
| 71 |
-
// display download link
|
| 72 |
-
download_report_btn.prop("href", response.data.path + "?name=systemInformation" );
|
| 73 |
-
download_report_btn.removeClass('stcr-hidden');
|
| 74 |
-
}
|
| 75 |
-
else if( response.data.result == "false" ) // if false show a error message with the file permission issue.
|
| 76 |
-
{
|
| 77 |
-
working_file_path.text(response.data.additionalInfo);
|
| 78 |
-
// Bootstrap alert box
|
| 79 |
-
download_report_error_container.removeClass('stcr-hidden');
|
| 80 |
-
}
|
| 81 |
-
}
|
| 82 |
-
}
|
| 83 |
-
}).fail( function(a) {
|
| 84 |
-
console.log("An error occurred on the server.");
|
| 85 |
-
}).done(function () {
|
| 86 |
-
spinner.addClass('stcr-hidden');
|
| 87 |
-
}); //close jQuery.ajax
|
| 88 |
-
}
|
| 89 |
-
});
|
| 90 |
-
|
| 91 |
-
download_report_btn.on( "click", function( event ) {
|
| 92 |
-
// event.preventDefault();
|
| 93 |
-
$( this ).addClass('stcr-hidden');
|
| 94 |
-
});
|
| 95 |
-
|
| 96 |
-
});
|
| 97 |
-
} )( jQuery );
|
| 1 |
/**
|
| 2 |
+
* Handles system page JavaScript
|
| 3 |
*/
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
jQuery(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
jQuery('.download_report').on( 'click', function(e) {
|
| 8 |
+
e.preventDefault();
|
| 9 |
+
jQuery('form[name="stcr_sysinfo_form"]').submit();
|
| 10 |
+
});
|
| 11 |
|
| 12 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options/stcr_system.php
CHANGED
|
@@ -211,29 +211,11 @@ else {
|
|
| 211 |
|
| 212 |
<div class="form-group row">
|
| 213 |
<label for="generate_system_info" class="col-sm-3 col-form-label text-right">
|
| 214 |
-
<?php _e( '
|
| 215 |
<div class="col-sm-7">
|
| 216 |
-
|
| 217 |
-
$nonceName = "generate_system_report";
|
| 218 |
-
$nonce = wp_create_nonce( $nonceName );
|
| 219 |
-
?>
|
| 220 |
-
<button id="generate_system_info" readonly="readonly"
|
| 221 |
-
class="generate_system_info btn btn-third subscribe-form-button"
|
| 222 |
-
<?php echo "data-nonce='{$nonce}|{$nonceName}'" ?>>
|
| 223 |
-
<?php _e( 'Generate', 'subscribe-reloaded' ); ?>
|
| 224 |
-
</button>
|
| 225 |
-
<span class="generate_spinner stcr-hidden"><i class="fas fa-play-circle"></i></span>
|
| 226 |
-
<a class="download_report btn btn-download subscribe-form-button stcr-hidden" href="#">
|
| 227 |
<?php _e( 'Download', 'subscribe-reloaded' ); ?>
|
| 228 |
</a>
|
| 229 |
-
<div style="height: 10px;"></div>
|
| 230 |
-
<div class="alert alert-danger stcr-hidden stcr-alert-box download_report_error" role="alert">
|
| 231 |
-
<p><?php _e('Please verify that you have the correct file permissions. WordPress System Info File could not be created !', 'subscribe-reloaded' );?>
|
| 232 |
-
</p>
|
| 233 |
-
<p style="font-weight: bold;"><?php _e( "Path: ", "subscribe-reloaded"); ?>
|
| 234 |
-
<span class="file-path" style="font-family: 'Courier New'"></span>
|
| 235 |
-
</p>
|
| 236 |
-
</div>
|
| 237 |
</div>
|
| 238 |
</div>
|
| 239 |
|
|
@@ -472,33 +454,14 @@ else {
|
|
| 472 |
$stcr_system_information['Server Environment']["cURL Version"] = 'cURL is not available';
|
| 473 |
}
|
| 474 |
|
| 475 |
-
//
|
| 476 |
-
|
| 477 |
-
{
|
| 478 |
-
$
|
| 479 |
-
|
| 480 |
-
else
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
{
|
| 484 |
-
$ver = mysql_get_server_info();
|
| 485 |
-
}
|
| 486 |
-
}
|
| 487 |
-
|
| 488 |
-
if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) )
|
| 489 |
-
{
|
| 490 |
-
$MySQLSVersion = $wpdb->db_version();
|
| 491 |
-
|
| 492 |
-
if ( version_compare( $MySQLSVersion, '5.6', '<' ) )
|
| 493 |
-
{
|
| 494 |
-
$MySQLSVersion = '<div class="system-error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'subscribe-reloaded' ), esc_html( $MySQLSVersion ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'subscribe-reloaded' ) . '</a>' ) . '</div>';
|
| 495 |
-
$stcr_system_information['Server Environment']["MySQL Version"] = sprintf( '%s - We recommend a minimum MySQL version of 5.6. See: %s', esc_html( $MySQLSVersion ), '<a href="https://wordpress.org/about/requirements/" target="_blank">WordPress Requirements</a>' );
|
| 496 |
-
}
|
| 497 |
-
else
|
| 498 |
-
{
|
| 499 |
-
$MySQLSVersion = '<div class="system-success">' . esc_html( $MySQLSVersion ) . '</div>';
|
| 500 |
-
$stcr_system_information['Server Environment']["MySQL Version"] = $wpdb->db_version();
|
| 501 |
-
}
|
| 502 |
}
|
| 503 |
|
| 504 |
// Get the Timezone
|
|
@@ -745,6 +708,12 @@ else {
|
|
| 745 |
<input class="reportPath" type="hidden" name="reportPath" value="<?php echo $reportPath; ?>">
|
| 746 |
<textarea class="reportData stcr-hidden" readonly name="reportPath" ><?php echo serialize( $stcr_system_information ); ?></textarea>
|
| 747 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 748 |
</div>
|
| 749 |
|
| 750 |
<div class="col-md-3">
|
|
@@ -768,9 +737,11 @@ else {
|
|
| 768 |
//global $wp_subscribe_reloaded;
|
| 769 |
// Tell WP that we are going to use a resource.
|
| 770 |
$wp_subscribe_reloaded->stcr->utils->register_script_to_wp( "stcr-system-info", "stcr_system.js", "includes/js/admin");
|
|
|
|
| 771 |
// Includes the Panel JS resource file as well as the JS text domain translations.
|
| 772 |
//$wp_subscribe_reloaded->stcr->stcr_i18n->stcr_localize_script( "stcr-system-info", "stcr_i18n", $wp_subscribe_reloaded->stcr->stcr_i18n->get_js_subs_translation() );
|
| 773 |
// Enqueue the JS File
|
| 774 |
$wp_subscribe_reloaded->stcr->utils->enqueue_script_to_wp( "stcr-system-info" );
|
|
|
|
| 775 |
|
| 776 |
?>
|
| 211 |
|
| 212 |
<div class="form-group row">
|
| 213 |
<label for="generate_system_info" class="col-sm-3 col-form-label text-right">
|
| 214 |
+
<?php _e( 'Download System Info File', 'subscribe-reloaded' ) ?></label>
|
| 215 |
<div class="col-sm-7">
|
| 216 |
+
<a class="download_report btn btn-download subscribe-form-button" href="#">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
<?php _e( 'Download', 'subscribe-reloaded' ); ?>
|
| 218 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
</div>
|
| 220 |
</div>
|
| 221 |
|
| 454 |
$stcr_system_information['Server Environment']["cURL Version"] = 'cURL is not available';
|
| 455 |
}
|
| 456 |
|
| 457 |
+
// check MySQL version
|
| 458 |
+
global $wp_version, $required_mysql_version;
|
| 459 |
+
if ( version_compare( $wpdb->db_version(), $required_mysql_version, '<' ) ) {
|
| 460 |
+
$MySQLSVersion = '<div class="system-error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) . '</div>';
|
| 461 |
+
$stcr_system_information['Server Environment']["MySQL Version"] = $wpdb->db_version();
|
| 462 |
+
} else {
|
| 463 |
+
$MySQLSVersion = '<div class="system-success">' . $wpdb->db_version() . '</div>';
|
| 464 |
+
$stcr_system_information['Server Environment']["MySQL Version"] = $wpdb->db_version();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
}
|
| 466 |
|
| 467 |
// Get the Timezone
|
| 708 |
<input class="reportPath" type="hidden" name="reportPath" value="<?php echo $reportPath; ?>">
|
| 709 |
<textarea class="reportData stcr-hidden" readonly name="reportPath" ><?php echo serialize( $stcr_system_information ); ?></textarea>
|
| 710 |
</form>
|
| 711 |
+
|
| 712 |
+
<form name="stcr_sysinfo_form" class="stcr-hidden" action="<?php echo esc_url( admin_url( 'admin.php?page=stcr_system' ) ); ?>" method="post">
|
| 713 |
+
<input type="hidden" name="stcr_sysinfo_action" value="download_sysinfo" />
|
| 714 |
+
<textarea name="stcr_sysinfo" readonly><?php echo serialize( $stcr_system_information ); ?></textarea>
|
| 715 |
+
</form>
|
| 716 |
+
|
| 717 |
</div>
|
| 718 |
|
| 719 |
<div class="col-md-3">
|
| 737 |
//global $wp_subscribe_reloaded;
|
| 738 |
// Tell WP that we are going to use a resource.
|
| 739 |
$wp_subscribe_reloaded->stcr->utils->register_script_to_wp( "stcr-system-info", "stcr_system.js", "includes/js/admin");
|
| 740 |
+
$wp_subscribe_reloaded->stcr->utils->register_script_to_wp( "stcr-subs-options", "subs_options.js", "includes/js/admin");
|
| 741 |
// Includes the Panel JS resource file as well as the JS text domain translations.
|
| 742 |
//$wp_subscribe_reloaded->stcr->stcr_i18n->stcr_localize_script( "stcr-system-info", "stcr_i18n", $wp_subscribe_reloaded->stcr->stcr_i18n->get_js_subs_translation() );
|
| 743 |
// Enqueue the JS File
|
| 744 |
$wp_subscribe_reloaded->stcr->utils->enqueue_script_to_wp( "stcr-system-info" );
|
| 745 |
+
$wp_subscribe_reloaded->stcr->utils->enqueue_script_to_wp( "stcr-subs-options" );
|
| 746 |
|
| 747 |
?>
|
readme.txt
CHANGED
|
@@ -7,7 +7,7 @@ Requires at least: 4.0
|
|
| 7 |
Requires PHP: 5.6
|
| 8 |
Requires MySQL: 5.6
|
| 9 |
Tested up to: 5.1
|
| 10 |
-
Stable tag:
|
| 11 |
License: GPLv2 or later
|
| 12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 13 |
|
|
@@ -98,24 +98,18 @@ Just go to the Options Panel and click the generate button. By generating a new
|
|
| 98 |
6. Check the number of subscribers in your posts.
|
| 99 |
7. Manage the subscriptions on the Frontend Side.
|
| 100 |
|
| 101 |
-
==
|
| 102 |
-
|
| 103 |
-
= v190305 =
|
| 104 |
-
|
| 105 |
-
* **Fix** Issue with "Subscribe authors" functionality sending the emails to administrator instead of the post author
|
| 106 |
-
|
| 107 |
-
= v190214 =
|
| 108 |
-
|
| 109 |
-
* **Fix** Compatibility with some PHP versions and MySQL. Fixes other minor issues.
|
| 110 |
-
|
| 111 |
-
= v190117 =
|
| 112 |
-
|
| 113 |
-
* **Upgrade** The backend interface to make the UX simpler for the user and Add option to get information of your WordPress System. Improve Logging with PHP errors catching.
|
| 114 |
|
| 115 |
-
=
|
| 116 |
-
**Fix** Information that was not been validated on the backened.
|
| 117 |
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
= v190305 =
|
| 121 |
|
| 7 |
Requires PHP: 5.6
|
| 8 |
Requires MySQL: 5.6
|
| 9 |
Tested up to: 5.1
|
| 10 |
+
Stable tag: 190325
|
| 11 |
License: GPLv2 or later
|
| 12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 13 |
|
| 98 |
6. Check the number of subscribers in your posts.
|
| 99 |
7. Manage the subscriptions on the Frontend Side.
|
| 100 |
|
| 101 |
+
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
+
= v190325 =
|
|
|
|
| 104 |
|
| 105 |
+
* **New** Shortcode for manage page content (to be used on non-virtual management page). The shortcode is [stcr_management_page]
|
| 106 |
+
* **Rewrite** New method for downloading system information file
|
| 107 |
+
* **Fix** The admin panel CSS and JavaScript files now load only on StCR pages
|
| 108 |
+
* **Fix** Tooltips not showing up on System options page
|
| 109 |
+
* **Fix** Conflict with MailChimp for WP plugin (comment filter received echo instead of return which caused the issue)
|
| 110 |
+
* **Fix** Issue with select/deselect all on management page
|
| 111 |
+
* **Tweak** The MySQL requirements info on the system page now uses WordPress requirements
|
| 112 |
+
* **Tweak** The post author will no longer be notified of his/her own comments
|
| 113 |
|
| 114 |
= v190305 =
|
| 115 |
|
subscribe-to-comments-reloaded.php
CHANGED
|
@@ -2,8 +2,7 @@
|
|
| 2 |
/*
|
| 3 |
Plugin Name: Subscribe to Comments Reloaded
|
| 4 |
|
| 5 |
-
Version:
|
| 6 |
-
Stable tag: 190305
|
| 7 |
Requires at least: 4.0
|
| 8 |
Tested up to: 5.1
|
| 9 |
|
| 2 |
/*
|
| 3 |
Plugin Name: Subscribe to Comments Reloaded
|
| 4 |
|
| 5 |
+
Version: 190325
|
|
|
|
| 6 |
Requires at least: 4.0
|
| 7 |
Tested up to: 5.1
|
| 8 |
|
templates/user.php
CHANGED
|
@@ -146,7 +146,7 @@ if ( is_array( $subscriptions ) && ! empty( $subscriptions ) ) {
|
|
| 146 |
var checkbox = $('form[name="post_list_form"] table input[type="checkbox"] ');
|
| 147 |
|
| 148 |
checkbox.each(function(index, element){
|
| 149 |
-
$(this).
|
| 150 |
});
|
| 151 |
|
| 152 |
event.preventDefault();
|
|
@@ -163,7 +163,7 @@ if ( is_array( $subscriptions ) && ! empty( $subscriptions ) ) {
|
|
| 163 |
var checkbox = $('form[name="post_list_form"] table input[type="checkbox"] ');
|
| 164 |
|
| 165 |
checkbox.each(function(index, element){
|
| 166 |
-
$(this).
|
| 167 |
});
|
| 168 |
|
| 169 |
event.preventDefault();
|
| 146 |
var checkbox = $('form[name="post_list_form"] table input[type="checkbox"] ');
|
| 147 |
|
| 148 |
checkbox.each(function(index, element){
|
| 149 |
+
$(this).prop('checked',true);
|
| 150 |
});
|
| 151 |
|
| 152 |
event.preventDefault();
|
| 163 |
var checkbox = $('form[name="post_list_form"] table input[type="checkbox"] ');
|
| 164 |
|
| 165 |
checkbox.each(function(index, element){
|
| 166 |
+
$(this).prop('checked',false);
|
| 167 |
});
|
| 168 |
|
| 169 |
event.preventDefault();
|
utils/stcr_manage.php
CHANGED
|
@@ -609,6 +609,37 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_manage') )
|
|
| 609 |
}
|
| 610 |
}
|
| 611 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 612 |
/**
|
| 613 |
* Adds a custom stylesheet file to the admin interface
|
| 614 |
*/
|
| 609 |
}
|
| 610 |
}
|
| 611 |
|
| 612 |
+
/**
|
| 613 |
+
* Download system information file
|
| 614 |
+
*
|
| 615 |
+
* @since 190325
|
| 616 |
+
* @return void
|
| 617 |
+
*/
|
| 618 |
+
function sysinfo_download() {
|
| 619 |
+
|
| 620 |
+
if ( ! isset( $_POST['stcr_sysinfo_action'] ) ) {
|
| 621 |
+
return;
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
if ( $_POST['stcr_sysinfo_action'] != 'download_sysinfo' ) {
|
| 625 |
+
return;
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
| 629 |
+
return;
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
nocache_headers();
|
| 633 |
+
|
| 634 |
+
header( 'Content-Type: text/plain' );
|
| 635 |
+
header( 'Content-Disposition: attachment; filename="stcr-sysinfo.txt"' );
|
| 636 |
+
|
| 637 |
+
echo stripslashes( $_POST['stcr_sysinfo'] );
|
| 638 |
+
|
| 639 |
+
exit;
|
| 640 |
+
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
/**
|
| 644 |
* Adds a custom stylesheet file to the admin interface
|
| 645 |
*/
|
utils/stcr_upgrade.php
CHANGED
|
@@ -410,18 +410,8 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_upgrade') ) {
|
|
| 410 |
$options_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'admin.php?page=stcr_options' ), __( 'Settings', 'subscribe-reloaded' ) );
|
| 411 |
$system_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'admin.php?page=stcr_system' ), __( 'Log Settings', 'subscribe-reloaded' ) );
|
| 412 |
|
| 413 |
-
if( $_fresh_install ) {
|
| 414 |
-
|
| 415 |
-
'notify_update_new_install',
|
| 416 |
-
'unread',
|
| 417 |
-
'<p>' . __('<strong>Thank you for installing Subscribe to Comments Reloaded!</strong>.', 'subscribe-reloaded') . '</p>' .
|
| 418 |
-
'<p>' . __('If you find a bug or an issue you can report it <a href="https://github.com/stcr/subscribe-to-comments-reloaded/issues" target="_blank">here</a>.', 'subscribe-reloaded') . '</p>' .
|
| 419 |
-
'<p>' . __('Please visit the <a href="https://wordpress.org/plugins/subscribe-to-comments-reloaded/changelog/" target="_blank">Changelog</a> for detailed information on plugin changes.'
|
| 420 |
-
. '<a class="dismiss" href="#">Dismiss. </a>'
|
| 421 |
-
. '<img class="stcr-loading-animation" src="' . esc_url(admin_url() . '/images/loading.gif') . '" alt="Working...">', 'subscribe-reloaded') . '</p>',
|
| 422 |
-
'updated'
|
| 423 |
-
);
|
| 424 |
-
} else {
|
| 425 |
switch ($_version) {
|
| 426 |
case '160106':
|
| 427 |
$this->stcr_create_admin_notice(
|
| 410 |
$options_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'admin.php?page=stcr_options' ), __( 'Settings', 'subscribe-reloaded' ) );
|
| 411 |
$system_link = sprintf( '<a href="%s"> %s </a>', admin_url( 'admin.php?page=stcr_system' ), __( 'Log Settings', 'subscribe-reloaded' ) );
|
| 412 |
|
| 413 |
+
if( ! $_fresh_install ) {
|
| 414 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 415 |
switch ($_version) {
|
| 416 |
case '160106':
|
| 417 |
$this->stcr_create_admin_notice(
|
utils/stcr_utils.php
CHANGED
|
@@ -544,20 +544,25 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_utils') )
|
|
| 544 |
* @since 03-Agu-2015
|
| 545 |
* @author reedyseth
|
| 546 |
*/
|
| 547 |
-
public function register_admin_scripts() {
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 561 |
}
|
| 562 |
/**
|
| 563 |
* Hooking scripts for admin pages.
|
| 544 |
* @since 03-Agu-2015
|
| 545 |
* @author reedyseth
|
| 546 |
*/
|
| 547 |
+
public function register_admin_scripts( $hook ) {
|
| 548 |
+
|
| 549 |
+
// check if we're on our pages
|
| 550 |
+
if ( strpos( $hook, 'stcr' ) !== false ) {
|
| 551 |
+
|
| 552 |
+
// paths
|
| 553 |
+
$stcr_admin_js = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/js/stcr-admin.js';
|
| 554 |
+
$stcr_admin_css = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/css/stcr-admin-style.css';
|
| 555 |
+
|
| 556 |
+
// scripts
|
| 557 |
+
wp_register_script('stcr-admin-js', $stcr_admin_js, array( 'jquery' ) );
|
| 558 |
+
wp_enqueue_script('stcr-admin-js');
|
| 559 |
+
|
| 560 |
+
// styles
|
| 561 |
+
wp_register_style( 'stcr-admin-style', $stcr_admin_css );
|
| 562 |
+
wp_enqueue_style('stcr-admin-style');
|
| 563 |
+
|
| 564 |
+
}
|
| 565 |
+
|
| 566 |
}
|
| 567 |
/**
|
| 568 |
* Hooking scripts for admin pages.
|
wp_subscribe_reloaded.php
CHANGED
|
@@ -6,7 +6,7 @@ if ( ! function_exists( 'add_action' ) ) {
|
|
| 6 |
exit;
|
| 7 |
}
|
| 8 |
|
| 9 |
-
define( __NAMESPACE__.'\\VERSION','
|
| 10 |
define( __NAMESPACE__.'\\DEVELOPMENT', true );
|
| 11 |
define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
|
| 12 |
|
|
@@ -51,7 +51,11 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
|
|
| 51 |
// Add subscriptions for tests
|
| 52 |
// $this->add_manual_subs( 50, 18,'Y', 'dev', 30);
|
| 53 |
}
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
|
|
|
| 55 |
// end __construct
|
| 56 |
public function add_manual_subs( $iterations = 1 ,$post_id, $status = 'Y', $email_prefix = 'dev', $last_id_subs = 0 )
|
| 57 |
{
|
|
@@ -144,6 +148,9 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
|
|
| 144 |
"generate_system_report" => "stcr_recreate_file"
|
| 145 |
)
|
| 146 |
);
|
|
|
|
|
|
|
|
|
|
| 147 |
}
|
| 148 |
}
|
| 149 |
|
|
@@ -343,10 +350,16 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
|
|
| 343 |
|
| 344 |
// If the case, notify the author
|
| 345 |
if ( get_option( 'subscribe_reloaded_notify_authors', 'no' ) == 'yes' ) {
|
|
|
|
| 346 |
$post_author_id = get_post_field( 'post_author', $info->comment_post_ID );
|
| 347 |
$post_author_data = get_userdata( $post_author_id );
|
| 348 |
$post_author_email = $post_author_data->user_email;
|
| 349 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
}
|
| 351 |
|
| 352 |
return $_comment_ID;
|
|
@@ -1240,7 +1253,7 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
|
|
| 1240 |
$output .= "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
|
| 1241 |
}
|
| 1242 |
|
| 1243 |
-
|
| 1244 |
} // end subscribe_reloaded_show
|
| 1245 |
|
| 1246 |
public function setUserCoookie() {
|
|
@@ -1255,5 +1268,18 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
|
|
| 1255 |
setcookie( 'comment_author_email_' . COOKIEHASH, $subscribe_to_comments_clean_email, time() + 1209600, '/' );
|
| 1256 |
}
|
| 1257 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1258 |
} // end of class declaration
|
| 1259 |
}
|
| 6 |
exit;
|
| 7 |
}
|
| 8 |
|
| 9 |
+
define( __NAMESPACE__.'\\VERSION','190325' );
|
| 10 |
define( __NAMESPACE__.'\\DEVELOPMENT', true );
|
| 11 |
define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
|
| 12 |
|
| 51 |
// Add subscriptions for tests
|
| 52 |
// $this->add_manual_subs( 50, 18,'Y', 'dev', 30);
|
| 53 |
}
|
| 54 |
+
|
| 55 |
+
add_shortcode( 'stcr_management_page', array( $this, 'management_page_sc' ) );
|
| 56 |
+
|
| 57 |
}
|
| 58 |
+
|
| 59 |
// end __construct
|
| 60 |
public function add_manual_subs( $iterations = 1 ,$post_id, $status = 'Y', $email_prefix = 'dev', $last_id_subs = 0 )
|
| 61 |
{
|
| 148 |
"generate_system_report" => "stcr_recreate_file"
|
| 149 |
)
|
| 150 |
);
|
| 151 |
+
|
| 152 |
+
add_action( 'admin_init', array( $this, 'sysinfo_download' ) );
|
| 153 |
+
|
| 154 |
}
|
| 155 |
}
|
| 156 |
|
| 350 |
|
| 351 |
// If the case, notify the author
|
| 352 |
if ( get_option( 'subscribe_reloaded_notify_authors', 'no' ) == 'yes' ) {
|
| 353 |
+
|
| 354 |
$post_author_id = get_post_field( 'post_author', $info->comment_post_ID );
|
| 355 |
$post_author_data = get_userdata( $post_author_id );
|
| 356 |
$post_author_email = $post_author_data->user_email;
|
| 357 |
+
|
| 358 |
+
// send email to author unless the author made the comment
|
| 359 |
+
if ( $info->comment_author_email != $post_author_email ) {
|
| 360 |
+
$this->notify_user( $info->comment_post_ID, $post_author_email, $_comment_ID );
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
}
|
| 364 |
|
| 365 |
return $_comment_ID;
|
| 1253 |
$output .= "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
|
| 1254 |
}
|
| 1255 |
|
| 1256 |
+
return $output . $submit_field;
|
| 1257 |
} // end subscribe_reloaded_show
|
| 1258 |
|
| 1259 |
public function setUserCoookie() {
|
| 1268 |
setcookie( 'comment_author_email_' . COOKIEHASH, $subscribe_to_comments_clean_email, time() + 1209600, '/' );
|
| 1269 |
}
|
| 1270 |
}
|
| 1271 |
+
|
| 1272 |
+
/**
|
| 1273 |
+
* Management page shortcode
|
| 1274 |
+
*
|
| 1275 |
+
* @since 190325
|
| 1276 |
+
*/
|
| 1277 |
+
public function management_page_sc() {
|
| 1278 |
+
|
| 1279 |
+
$data = $this->subscribe_reloaded_manage();
|
| 1280 |
+
return $data[0]->post_content;
|
| 1281 |
+
|
| 1282 |
+
}
|
| 1283 |
+
|
| 1284 |
} // end of class declaration
|
| 1285 |
}
|
