﻿ÿØÿà JFIF      ÿÛ „ 	 ( %!1"%)+...383-7(-.+



-%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ               ÿÄ @       !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ             ÿÄ '        1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ï
-3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéß¦$$½—šÙÜCC¯¶è8Î²–Åkèwx
LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2Þ¿Ø¯­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÃ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’×©T]
ªb—ÊîKC^×M“xùäñz¬zJ×{4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi
[0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú	Ò˜Æ}2VE•Ð€p¡Ô3Úº …h³^Ç‡ºçì¥Ánó|˜ÖˆÎˆ+«¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<Ì‰Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈÀá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ
ƒÜÒ?	:õdsÀ–3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LÇÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl
Í›G¹ÀPá¼Nc¡šÒ…ÙWÍ³œ±vÊáÐ„×9‹P‰cEØ‘™›µŸP<×g1
º©Ø¬wiÁ^l5×I/';Ë+´Z‡ÓÄFÕp[Èð’
HÄ	ó
9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ
QãñQtIeórVB,ÏÂf‹4#Îœc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ
÷jsÏ‚Ò’KÈcø(é›;k(’#ôŒQ
™C>
õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~È¦—’-$fe«"FâUˆÊwµPÏu
w+"åÉoÌ¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ÉdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt
·K¢ÅÅ·¥RÄÊÉbKn
N­R2g$VµÕó
Qr#–ÓZUÏð0ÎtÙÀœz
ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Î”â‘ËØ´IˆÓ°Ë‰ÞM<J•›C=ìu*Ü§„Ã¤GËŠô;5ŒÁ£ñùä¬6Ì2¦‘žh¸Rº<Õš%÷ …Ç	‚g‡.
>3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z
à¾]
üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.Å¾„æ“I[ª+·zÐÒÚ,½Ð»¶€C›7jk$à¹–€Ž¾ÅÙpp¶ÍþéÎ¤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ä†f× æ¢Æ±qWÄ±[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGŽ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ Æˆæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„
g01¬„åEMè›‡Ã\6µE›‘fÙO	k÷CºnÓ1`iîÒ²áÂ!ÑLÄÿ 
³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#»
Ç\……ßïIœÉ$¸ÎñÍ®ÔHÃ‡	Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡	—JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ	5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*ç¦ŒÉù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnÝ³vðÖKE¼‚ »mà ÷f®:Ë™–4rð¡4` Ü¹çž~‹C=œ…¾Ïj|VDtK.ƒ"9	Ï
­–éXá³6WÒïIL-Ð‡
Ç
home/aaamarke/public_html/wp-content/mu-plugins/wp-staging-optimizer.php                            0000644                 00000017270 15266303137 0022564 0                                                                                                    ustar 00                                                                                                                                                                                                                                                       <?php

/*
 * Plugin Name: WP STAGING Optimizer
 * Plugin URI: https://wp-staging.com
 * Description: Prevents 3rd party plugins from being loaded during WP STAGING specific operations.
 *
 * This is a must-use standalone plugin -
 * Do not use any of these methods in WP STAGING code base as this mu-plugin can be missing!
 *
 * Author: René Hermenau
 * Version: 1.4
 * Author URI: https://wp-staging.com
 */

// Version number of this mu-plugin. Important for automatic updates
if (!defined('WPSTG_OPTIMIZER_VERSION')) {
    define('WPSTG_OPTIMIZER_VERSION', 1.4);
}

/** @return string */
function wpstgGetPluginsDir()
{

    $pluginsDir = '';
    if (defined('WP_PLUGIN_DIR')) {
        $pluginsDir = trailingslashit(WP_PLUGIN_DIR);
    } else if (defined('WP_CONTENT_DIR')) {
        $pluginsDir = trailingslashit(WP_CONTENT_DIR) . 'plugins/';
    }
    return $pluginsDir;
}

/*
 * Check if optimizer is enabled
 * @return bool false if it's disabled
 *
 */

function wpstgIsEnabledOptimizer()
{

    $status = ( object )get_option('wpstg_settings');

    if ($status && isset($status->optimizer) && $status->optimizer == 1) {
        return true;
    }

    return false;
}

/**
 * Check if certain plugins are excluded and still runing during wp staging requests
 * @return boolean
 */
function wpstgIsExcludedPlugin($plugin)
{
    $excludedPlugins = get_option('wpstg_optimizer_excluded', []);

    if (empty($excludedPlugins)) {
        return false;
    }

    // Check for custom excluded plugins
    foreach ($excludedPlugins as $excludedPlugin) {
        if (strpos($plugin, $excludedPlugin) !== false) {
            return true;
        } else {
            continue;
        }
    }

    return false;
}

/**
 * Remove all plugins except wp-staging and wp-staging-pro from blog-active plugins
 *
 * @param array $plugins numerically keyed array of plugin names
 *
 * @return array
 */
function wpstgExcludePlugins($plugins)
{
    if (!is_array($plugins) || empty($plugins)) {
        return $plugins;
    }

    if (!wpstgIsCompatibilityModeRequest()) {
        return $plugins;
    }

    foreach ($plugins as $key => $plugin) {

        // Default filter. Must be at the beginning or wp staging plugin will be filtered and killed
        if (strpos($plugin, 'wp-staging') !== false || wpstgIsExcludedPlugin($plugin)) {
            continue;
        }
        unset($plugins[$key]);
    }


    return $plugins;
}

add_filter('option_active_plugins', 'wpstgExcludePlugins');

/**
 * Remove all plugins except wp-staging and wp-staging-pro from network-active plugins
 *
 * @param array $plugins array of plugins keyed by name (name=>timestamp pairs)
 *
 * @return array
 */
function wpstgExcludeSitePlugins($plugins)
{
    if (!is_array($plugins) || empty($plugins)) {
        return $plugins;
    }

    if (!wpstgIsCompatibilityModeRequest()) {
        return $plugins;
    }

    foreach ($plugins as $key => $plugin) {

        // Default filter. Must be at the beginning or wp staging plugin will be filtered and killed
        if (strpos($plugin, 'wp-staging') !== false || wpstgIsExcludedPlugin($plugin)) {
            continue;
        }
    }

    return $plugins;
}

add_filter('site_option_active_sitewide_plugins', 'wpstgExcludeSitePlugins');

/**
 *
 * Disables the theme during WP Staging AJAX requests
 *
 *
 * @param $dir
 *
 * @return string
 */
function wpstgDisableTheme($dir)
{
    $enableTheme = apply_filters('wpstg_optimizer_enable_theme', false);

    if (wpstgIsCompatibilityModeRequest() && $enableTheme === false) {
        $wpstgRootPro = wpstgGetPluginsDir() . 'wp-staging-pro';
        $wpstgRoot = wpstgGetPluginsDir() . 'wp-staging';

        $file = DIRECTORY_SEPARATOR . 'Backend' . DIRECTORY_SEPARATOR . 'Optimizer' . DIRECTORY_SEPARATOR . 'blank-theme' . DIRECTORY_SEPARATOR . 'functions.php';
        $theme = DIRECTORY_SEPARATOR . 'Backend' . DIRECTORY_SEPARATOR . 'Optimizer' . DIRECTORY_SEPARATOR . 'blank-theme';


        if (file_exists($wpstgRoot . $file)) {
            return $wpstgRoot . $theme;
        } elseif (file_exists($wpstgRootPro . $file)) {
            return $wpstgRootPro . $theme;
        } else {
            return '';
        }
        return $themeDir;
    }

    return $dir;
}

add_filter('stylesheet_directory', 'wpstgDisableTheme');
add_filter('template_directory', 'wpstgDisableTheme');

/**
 * Should the current request be processed by Compatibility Mode?
 *
 * @return bool
 */
function wpstgIsCompatibilityModeRequest()
{

    // Optimizer not enabled
    if (!wpstgIsEnabledOptimizer()) {
        return false;
    }

    if (!defined('DOING_AJAX') ||
        !DOING_AJAX ||
        !isset($_POST['action']) ||
        strpos($_POST['action'], 'wpstg') === false
    ) {

        return false;
    }

    return true;
}

/**
 * Remove TGM Plugin Activation 'force_activation' admin_init action hook if present.
 *
 * This is to stop excluded plugins being deactivated after a migration, when a theme uses TGMPA to require a plugin to be always active.
 */
function wpstgTgmpaCompatibility()
{
    $remove_function = false;

    // run on wpstg page
    if (isset($_GET['page']) && $_GET['page'] == 'wpstg_clone') {
        $remove_function = true;
    }
    // run on wpstg ajax requests
    if (defined('DOING_AJAX') && DOING_AJAX && isset($_POST['action']) && strpos($_POST['action'], 'wpstg') !== false) {
        $remove_function = true;
    }

    if ($remove_function) {
        global $wp_filter;
        $admin_init_functions = $wp_filter['admin_init'];
        foreach ($admin_init_functions as $priority => $functions) {
            foreach ($functions as $key => $function) {
                // searching for function this way as can't rely on the calling class being named TGM_Plugin_Activation
                if (strpos($key, 'force_activation') !== false) {
                    unset($wp_filter['admin_init'][$priority][$key]);

                    return;
                }
            }
        }
    }
}

add_action('admin_init', 'wpstgTgmpaCompatibility', 1);

/**
 * @return bool True if is staging site. False otherwise.
 */
function wpstgIsStaging()
{
    if (file_exists(ABSPATH . '.wp-staging-cloneable')) {
        return false;
    }

    if (get_option("wpstg_is_staging_site") === "true") {
        return true;
    }

    if (file_exists(ABSPATH . '.wp-staging')) {
        return true;
    }

    return false;
}

/**
 * Disable all outgoing e-mails on Staging site
 */
if (((bool)get_option("wpstg_emails_disabled") === true) && wpstgIsStaging()) {
    if (!function_exists('wp_mail')) {
        function wp_mail($to, $subject, $message, $headers = '', $attachments = [])
        {
            if (defined('WPSTG_DEBUG') && WPSTG_DEBUG) {
                // Safely cast everything to string
                $to = is_string($to) ? $to : wp_json_encode($to);
                $subject = is_string($subject) ? $subject : wp_json_encode($subject);
                $message = is_string($message) ? $message : wp_json_encode($message);
                $headers = is_string($headers) ? $headers : wp_json_encode($headers);
                $attachments = is_string($attachments) ? $attachments : wp_json_encode($attachments);

                $log_entry = <<<LOG_ENTRY
/***
* WPSTAGING - Mails are disabled for this Staging site. This e-mail was going to be sent, but was prevented:
***
* To: $to
***
* Subject: $subject
***
* Message: $message
***
* Headers: $headers
***
* Attachments: $attachments
***/
LOG_ENTRY;

                error_log($log_entry);
            }
        }
    } else {
        if (defined('WPSTG_DEBUG') && WPSTG_DEBUG) {
            error_log("WPSTAGING: Could not override the wp_mail() function to disable e-mails on staging site, as it was already defined before the optimizer mu-plugin was loaded.");
        }
    }
}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        