fixes + new version

This commit is contained in:
ruben- 2016-02-17 20:38:44 +01:00
parent dbef577add
commit d3d77e70ef
4 changed files with 28 additions and 15 deletions

View file

@ -79,7 +79,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus
} }


class MainWP_Child { class MainWP_Child {
public static $version = '3.0.2'; public static $version = '3.1';
private $update_version = '1.3'; private $update_version = '1.3';


private $callableFunctions = array( private $callableFunctions = array(
@ -426,9 +426,7 @@ class MainWP_Child {
} }


function template_redirect() { function template_redirect() {
if ( 1 === (int) get_option( 'mainwp_maintenance_opt_alert_404' ) ) { $this->maintenance_alert_404();
$this->maintenance_alert_404();
}
} }




@ -947,17 +945,13 @@ class MainWP_Child {
// echo '<pre>'; // echo '<pre>';
// $start = microtime(true); // $start = microtime(true);
// //
// print_r(wp_get_translation_updates());
//
// print_r($this->getSiteStats(array(), false));
//

// $stop = microtime(true); // $stop = microtime(true);
// die(($stop - $start) . 's</pre>'); // die(($stop - $start) . 's</pre>');
} }


//Register does not require auth, so we register here.. //Register does not require auth, so we register here..
if ( isset( $_POST['function'] ) && 'register' === $_POST['function'] ) { if ( isset( $_POST['function'] ) && 'register' === $_POST['function'] ) {
define( 'DOING_CRON', true );
$this->registerSite(); $this->registerSite();
} }


@ -1015,8 +1009,10 @@ class MainWP_Child {


//Call the function required //Call the function required
if ( $auth && isset( $_POST['function'] ) && isset( $this->callableFunctions[ $_POST['function'] ] ) ) { if ( $auth && isset( $_POST['function'] ) && isset( $this->callableFunctions[ $_POST['function'] ] ) ) {
define( 'DOING_CRON', true );
call_user_func( array( $this, $this->callableFunctions[ $_POST['function'] ] ) ); call_user_func( array( $this, $this->callableFunctions[ $_POST['function'] ] ) );
} else if ( isset( $_POST['function'] ) && isset( $this->callableFunctionsNoAuth[ $_POST['function'] ] ) ) { } else if ( isset( $_POST['function'] ) && isset( $this->callableFunctionsNoAuth[ $_POST['function'] ] ) ) {
define( 'DOING_CRON', true );
call_user_func( array( $this, $this->callableFunctionsNoAuth[ $_POST['function'] ] ) ); call_user_func( array( $this, $this->callableFunctionsNoAuth[ $_POST['function'] ] ) );
} }


@ -2665,7 +2661,7 @@ class MainWP_Child {


// to fix bug // to fix bug
$fix_update_plugins = get_site_transient( 'tofix_update_plugins' ); $fix_update_plugins = get_site_transient( 'tofix_update_plugins' );
if ( count($fix_update_plugins) > 0 ) { if ( is_array( $fix_update_plugins ) && ( count( $fix_update_plugins ) > 0 ) ) {
foreach( $fix_update_plugins as $slug => $plugin_update ) { foreach( $fix_update_plugins as $slug => $plugin_update ) {
if ( !isset( $information['plugin_updates'][ $slug ] ) ) { if ( !isset( $information['plugin_updates'][ $slug ] ) ) {
$information['plugin_updates'][ $slug ] = $plugin_update; $information['plugin_updates'][ $slug ] = $plugin_update;
@ -3683,7 +3679,7 @@ class MainWP_Child {
//Show stats without login - only allowed while no account is added yet //Show stats without login - only allowed while no account is added yet
function getSiteStatsNoAuth( $information = array() ) { function getSiteStatsNoAuth( $information = array() ) {
if ( get_option( 'mainwp_child_pubkey' ) ) { if ( get_option( 'mainwp_child_pubkey' ) ) {
$hint = '<br/>' . __('Hint 1: Go to the child site, deactivate and reactivate the MainWP Child plugin and try again.<br/>Hint 2: Please verify that the ctype_digit() PHP function has not been disabled on your child site server.', 'mainwp-child'); $hint = '<br/>' . __('Hint: Go to the child site, deactivate and reactivate the MainWP Child plugin and try again.', 'mainwp-child');
MainWP_Helper::error(__('This site already contains a link - please disable and enable the MainWP plugin.','mainwp-child') . $hint); MainWP_Helper::error(__('This site already contains a link - please disable and enable the MainWP plugin.','mainwp-child') . $hint);
} }


@ -4030,6 +4026,11 @@ class MainWP_Child {
if ( ! is_404() ) { if ( ! is_404() ) {
return; return;
} }

if ( 1 !== (int) get_option( 'mainwp_maintenance_opt_alert_404' ) ) {
return;
}

$email = get_option( 'mainwp_maintenance_opt_alert_404_email' ); $email = get_option( 'mainwp_maintenance_opt_alert_404_email' );


if ( empty( $email ) || ! preg_match( '/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/is', $email ) ) { if ( empty( $email ) || ! preg_match( '/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/is', $email ) ) {

View file

@ -293,12 +293,12 @@ class MainWP_Security {
if ( $force || self::get_security_option( 'generator_version' ) ) { if ( $force || self::get_security_option( 'generator_version' ) ) {
$types = array( 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export' ); $types = array( 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export' );
foreach ( $types as $type ) { foreach ( $types as $type ) {
add_filter( 'get_the_generator_' . $type, array( &$this, 'custom_the_generator' ), 10, 2 ); add_filter( 'get_the_generator_' . $type, array( 'MainWP_Security', 'custom_the_generator' ), 10, 2 );
} }
} }
} }


function custom_the_generator( $generator, $type = '' ) { public static function custom_the_generator( $generator, $type = '' ) {
return ''; return '';
} }



View file

@ -6,7 +6,7 @@
Author: MainWP Author: MainWP
Author URI: http://mainwp.com Author URI: http://mainwp.com
Text Domain: mainwp-child Text Domain: mainwp-child
Version: 3.0.2 Version: 3.1
*/ */
if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) { if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) {
header( 'X-Frame-Options: ALLOWALL' ); header( 'X-Frame-Options: ALLOWALL' );

View file

@ -7,7 +7,7 @@ Author URI: https://mainwp.com
Plugin URI: https://mainwp.com Plugin URI: https://mainwp.com
Requires at least: 3.6 Requires at least: 3.6
Tested up to: 4.4.1 Tested up to: 4.4.1
Stable tag: 3.0.2 Stable tag: 3.1
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html


@ -57,6 +57,18 @@ To see full documentation and FAQs please visit [MainWP Documentation](http://do


== Changelog == == Changelog ==


= 3.1 - 2-17-16 =
Fixed: PHP notices
Fixed: Escape html error for the contact support feature of the Branding Extension
Fixed: The issue with removing generator version
Fixed: Update issue for the iThemes Security Pro and the Monarch plugin
Fixed: Compatibility issue with the BackUpWordPress plugin
Added: Auto detect manually removed script/style versions feature
Added: Wordpress translation updates
Added: New Branding option to disable theme switching
Enhancement: Removed ctype_digit requirement
Enhancement: Install plugin error message

= 3.0.2 - 1-22-16 = = 3.0.2 - 1-22-16 =
* Fixed: Issue with scheduled BackupWordpress when run from dashboard * Fixed: Issue with scheduled BackupWordpress when run from dashboard
* Fixed: Issue with Heatmap tracker javascript * Fixed: Issue with Heatmap tracker javascript